我有一個安裝腳本,允許用戶指定他們想要安裝我的應用程序的位置。它是在[Code]
塊內的Pascal腳本的形式。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的新手。
謝謝。
它默認爲你問它默認什麼。所以改變默認值。 –
你爲什麼低調呢?我不問在嚮導期間如何更改默認值。我問如何處理用戶可以提供的靜默安裝參數文件,以便他們控制他們希望安裝應用程序的位置。 –
嗯,正是爲了這個。讓你向我們解釋你想要什麼。問題是缺少這一確切的信息。現在+1。 –