2017-09-04 2 views
0

QT IFW로 만든 바로 가기에 인수를 추가하는 방법을 아는 사람 있습니까? 인수가 전달되기 위해 실행되는 EXE가 필요합니다.Qt Installer Framework : 인수가있는 바로 가기 만들기

여기 (인수없이) 작동 무엇 :

component.addOperation("CreateShortcut", 
    "@[email protected]/MyApp.exe", 
    "@[email protected]/@[email protected]", 
    "[email protected]@", 
    "[email protected]@/MyApp.exe", 
    "iconId=0"); 

내가 EXE가 전달 -c 같은 것을 싶어. 나는 몇 가지 접근법을 시도했지만 운이 없다.

답변

1

Qt를 설치 프레임 워크 문서는 매우 가난하지만, 다음과 같은 operations에서 읽을 수 있습니다 "CreateShortcut" filename linkname [arguments]

이 LINKNAME하기 위해 파일 이름에 지정된 파일의 바로 가기를 만듭니다. Windows에서는 인수를 가질 수있는 .lnk 파일이 작성됩니다. 유닉스에서는 심볼릭 링크를 만든다.

그래서 그런 식으로 그것을 할 : C:\YourAppDirectory\Appname.exe -param

편집 : LNK 대상 요소에

component.addOperation("CreateShortcut", "@[email protected]/Appname.exe", "@[email protected]/Appname.lnk", "-param"); 

결과를 귀하의 경우 나를 위해뿐만 아니라 작동합니다

component.addOperation("CreateShortcut","@[email protected]/Appname.exe","@[email protected]/@‌​[email protected]", "-param", "[email protected]@", "[email protected]@/Appnam‌​e.exe","iconId=0"); 

-param도 마지막 인수로 사용됩니다.

+0

가능하면 테스트 해주세요. 그것은 나를 위해 작동하지 않습니다. 내가 그것을 할 때 "예기치 않은 토큰"을 반환합니다. 현재 매개 변수를 더 많이 전달하지만 모두 "명명 된"특정 용도로 사용됩니다. – BuvinJ

+0

@BuvinJ 잘 작동합니다. 'component.addOperation ("CreateShortcut", "@ [email protected]/Appname.exe", "@ StartMenuDir @/@ ProductName @ .lnk", "-param", "workingDirectory = @ TargetDir @ ", \t"iconPath = @ TargetDir @/Appname.exe ","iconId = 0 ");'정확히 어디에서 오류가 발생합니까? – Macias

+0

음 ... 기다려. 어쩌면 나는 다른 곳에 오타가있을 수있다. – BuvinJ