我想在我的 Inno Setup 步骤中使用 PowerShell(64 位版本)ssPostInstall
,但它总是打开一个 32 位 PowerShell。
正如您在我的脚本中看到的,我的 Inno Setup 被配置为 64 位应用程序。当我开始设置时,我可以在任务管理器中看到它作为 32 位应用程序运行
将打开的 PowerShell 也处于 32 位模式。
这是我的 Inno Stup 脚本:
[Setup]
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
PrivilegesRequired=admin
[Code]
Procedure CurStepChanged(CurrentStep:TSetupStep);
var
i, ResultCode, ErrorCode: Integer;
findRec: TFindRec;
isInstallationCmdSuccessful: Boolean;
folderNameOfUpdateIni: String;
ReturnCode: Boolean;
begin
if CurrentStep = ssPostInstall then begin
Log('Starting post install steps, calling install.ps1');
ReturnCode := ShellExec('open', ExpandConstant('{sys}\WindowsPowerShell\v1.0\powershell.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ErrorCode);
if (ReturnCode = True) then
Log('post install returned true')
else
Log('post install returned false');
Log('Starting post install steps, calling install.ps1');
ReturnCode := ShellExec('open', ExpandConstant('{syswow64}\WindowsPowerShell\v1.0\powershell.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ErrorCode);
if (ReturnCode = True) then
Log('post install returned true')
else
Log('post install returned false');
end;
end;
如何强制 Inno Setup 打开 64 位 PowerShell?