ため
おかげであなたが探しているものを行うことが可能です。しかし、[code]セクションにかなりの量のコードが必要です。私は何年も前に似たようなことをしましたが、私はINIだけを読んでいました。私は決してINIファイルに書きました。 SetIni *(SetIniString、SetIniBoolなど)関数を使用して書き込むことができるはずです。 GetIni *関数を使用してINIファイルを読むことができます。
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{4CCA332F-C69B-48DF-93B4-145EB88A1BCB}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetDefaultDir}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\util\innosetup\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent
[Code]
var
FinishedInstall : boolean;
function GetDefaultDir(def: string): string;
var
sInstallPath : string;
bRes : boolean;
begin
sInstallPath := GetIniString('Common', 'TargetDir', ExpandConstant('{pf}') + '\myApp', ExpandConstant('{src}') + '\myappsetup.INI');
Result := sInstallPath;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
FinishedInstall := True;
end;
procedure DeinitializeSetup();
var
bIni : boolean;
begin
if FinishedInstall then
bIni := SetIniString('Common', 'TargetDir',ExpandConstant('{app}'), ExpandConstant('{app}') + '\myappsetup.INI');
end;
ありがとうMirtheil、私はこれからいくつかの良いアイデアを持っています。しかし、これを使用するには、実際のインストールが始まる前に、どのイベントプロシージャがユーザーの選択肢にアクセスできるかを正確に知る必要があります。また、(アプリケーションディレクトリやグループのような)標準ダイアログ上で、ユーザの選択肢にアクセスするにはどうしたらいいですか? – LittleFish
上記のサンプルは、アプリケーションディレクトリを設定します。定数{groupname}を設定する "DefaultGroupName"と同様のコードを実行して、プログラムグループに適用することができます。ほとんどの標準ダイアログは情報をさまざまな定数に格納します。 – mirtheil