Я хочу использовать PowerShell (64-разрядная версия) на шаге ssPostInstall
в моей настройке Inno, но он всегда открывает 32-разрядную PowerShell.
Как вы можете видеть в моем сценарии, мой InnoПрограмма установки настроена как 64-битное приложение.Когда я запускаю установку, я вижу в диспетчере задач, что он работает как 32-разрядное приложение
![enter image description here](https://i.stack.imgur.com/iUVJP.png)
Также PowerShell, который будет открыт, находится в 32-битном режиме.
![enter image description here](https://i.stack.imgur.com/ZQtpb.png)
Вот мой сценарий 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