如果安装了程序,Inno Setup会跳转到第二页

时间:2018-06-07 23:13:44

标签: installer inno-setup pascal

首次安装时,一切运行顺畅,但是如果我再次运行安装程序,它只会跳到第二页询问我想要放置其他文件的位置,然后在就绪页面中只显示其他文件文件夹的参数。设置了忽略版本标志,还有什么呢?

image showing ready page ignoring main app

[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
Compression=lzma
SolidCompression=yes
OutputBaseFilename=aeolian_meditation_setup
WizardSmallImageFile=compiler:greenlogo.bmp
WizardImageFile=compiler:glogo.bmp
DirExistsWarning=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
;Main program that will be installed in {app} folder
Source: "D:\ocean_swift\Flowstone Projects\Aeolian Meditation Advanced\OS Aeolian Meditation Advanced A191.exe"; DestDir: "{app}"; Flags: ignoreversion

;Database file that will installed where user choosed
Source: "D:\ocean_swift\Flowstone Projects\Aeolian Meditation Advanced\onts\OpenSans-Regular.ttf"; DestDir: "{fonts}"; Flags: onlyifdoesntexist; FontInstall: "Open Sans"
Source: "C:\Program Files (x86)\VSTPlugins\OS Aeolian Meditation Advanced A191.dll"; DestDir: "{code:GetDataDir}"

[Code]
var
  DataDirPage: TInputDirWizardPage;

procedure InitializeWizard;
begin
  // Create the page

  DataDirPage := CreateInputDirPage(wpSelectDir,
    'Select 32bit VST Plugin Directory', 'Where should the 32bit VSTi plugin be installed??',
    'Select the folder in which Setup should install the 32bit VSTi plugin, then click Next.',
    False, '');
  DataDirPage.Add('');

  DataDirPage.Values[0] := 'C:\Program Files (x86)\VSTPlugins\';
end;

procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
  // Store the selected folder for further reinstall/upgrade
  SetPreviousData(PreviousDataKey, 'DataDir', DataDirPage.Values[0]);
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  // Set default folder if empty
  if DataDirPage.Values[0] = '' then
     DataDirPage.Values[0] := ExpandConstant('{sd}\DataDir');
  Result := True;
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo,
  MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  S: String;
begin
  // Fill the 'Ready Memo' with the normal settings and the custom settings
  S := '';

  S := S + MemoDirInfo + NewLine + NewLine;

  S := S + '32bit VSTi' + NewLine;
  S := S + Space + DataDirPage.Values[0] + NewLine;

  Result := S;
end;

function GetDataDir(Param: String): String;
begin
  { Return the selected DataDir }
  Result := DataDirPage.Values[0];
end;   

1 个答案:

答案 0 :(得分:0)

如果查看here,您会看到DisableProgramGroupPage的默认值为auto。如上所述:

  

如果设置为auto,则启动时安装程序将在注册表中查找   看看是否已经安装了相同的应用程序,如果已安装,它会   不显示选择开始菜单文件夹向导页面。

如果您查看帮助文件中的其他Disable条目,您会看到它们的行为相同。在新安装期间仅显示这些页面是合乎逻辑的。通过将这些行为设置为no来更改默认行为。