MsgBox()が使える
CurStep = ssInstallはインストールプロセスが開始された時。
実際のファイルコピーが開始される前にカスタムアクションを実行することができます。
[Code]
var
ShouldCreateRestorePoint: Boolean;
function InitializeSetup(): Boolean;
begin
// ユーザーに復元ポイントの作成を尋ねる
ShouldCreateRestorePoint := (MsgBox('復元ポイントを作成しますか?', mbConfirmation, MB_YESNO) = IDYES);
Result := True;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
// インストール開始時に復元ポイントを作成する
if (CurStep = ssInstall) and ShouldCreateRestorePoint then
begin
Exec('powershell.exe', '-ExecutionPolicy RemoteSigned -File "{app}\checkpoint.ps1" runas', '', SW_HIDE, ewWaitUntilTerminated, 0);
end;
end;