사용자가 응용 프로그램을 설치할 위치를 지정할 수있는 설치 스크립트가 있습니다. [Code]
블록 내에 파스칼 스크립트 형식입니다.Inno 설치 자동 설치를 위해 파일 (.inf)에서 사용자 지정 설치 설정의 기본값을로드하십시오.
var
SelectUsersPage: TInputOptionWizardPage;
IsUpgrade : Boolean;
UpgradePage: TOutputMsgWizardPage;
procedure InitializeWizard();
var
AlreadyInstalledPath: String;
begin
{ Determine if it is an upgrade... }
{ Read from registry to know if this is a fresh install or an upgrade }
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppId}_is1', 'Inno Setup: App Path', AlreadyInstalledPath) then
begin
{ So, this is an upgrade set target directory as installed before }
WizardForm.DirEdit.Text := AlreadyInstalledPath;
{ and skip SelectUsersPage }
IsUpgrade := True;
{ Create a page to be viewed instead of Ready To Install }
UpgradePage := CreateOutputMsgPage(wpReady,
'Ready To Upgrade', 'Setup is now ready to upgrade {#MyAppName} on your computer.',
'Click Upgrade to continue, or click Back if you want to review or change any settings.');
end
else
begin
IsUpgrade:= False;
end;
{ Create a page to select between "Just Me" or "All Users" }
SelectUsersPage := CreateInputOptionPage(wpLicense,
'Select Users', 'For which users do you want to install the application?',
'Select whether you want to install the library for yourself or for all users of this computer. Click next to continue.',
True, False);
{ Add items }
SelectUsersPage.Add('All users');
SelectUsersPage.Add('Just me');
{ Set initial values (optional) }
SelectUsersPage.Values[0] := False;
SelectUsersPage.Values[1] := True;
end;
그래서 자동 설치를 어떻게 지원할 수 있습니까? 사용자가 /SILENT
또는 /VERYSILENT
을 호출하면 설치 프로그램의 기본값은 SelectUsersPage.Values[1]
이며 Just Me
입니다. 응답 파일을 제공하여 설치 디렉토리를 변경하려는 사용자를 지원하도록 돕고 싶습니다.
나는이 코드를 모두 개발하지 않았으며 Pascal을 가진 초보자입니다.
감사합니다.
이 기본값을 당신이 기본값을 물어 무엇을. 기본값을 변경하십시오. –
왜 이것을 downvote하셨습니까? 마법사 중에 기본값을 변경하는 방법을 묻지 않습니다. 사용자가 제공 할 수있는 자동 설치 매개 변수 파일을 처리하는 방법을 묻습니다. 앱을 설치할 위치를 제어 할 수 있습니다. –
음, 정확히 이것 때문입니다. 네가 원하는 걸 우리에게 설명하게하기 위해서. 문제는이 정확한 정보가 누락되었습니다. +1하세요. –