My Innosetup script running in x64 mode successfully copies a 64-bit executable into the system32 directory. The problem occurs when I try to do a "postinstall" run of that executable.
The script is initialized with the following so that it runs in x64 mode:
ArchitecturesAllowed = x64
ArchitecturesInstallIn64BitMode = x64
PrivilegesRequired=admin
In the [Run] section I try to launch the executable with the following lines and wind up with the following errors:
Filename: "{sys}\{#MyAppExeName}";Description: "Launch application"; WorkingDir: "{sys}"; Flags: postinstall nowait skipifsilent
Error: CreateProcess failed; code 740. The requested operation requires elevation
Filename: "{sys}\{#MyAppExeName}";Description: "Launch application"; WorkingDir: "{sys}"; Flags: postinstall nowait skipifsilent runascurrentuser
Error: CreateProcess failed; code 740. The requested operation requires elevation
Filename: "{sys}\{#MyAppExeName}";Description: "Launch application"; WorkingDir: "{sys}"; Flags: nowait postinstall shellexec skipifsilent
Error: ShellExecuteEx failed; code 2. The system cannot find the file specified
Filename: "{sys}\{#MyAppExeName}";Description: "Launch application"; WorkingDir: "{sys}"; Flags: nowait postinstall shellexec skipifsilent runascurrentuser
Error: ShellExecuteEx failed; code 2. The system cannot find the file specified
Changing the directory to the {app} directory:
Filename: {app}\{#MyAppExeName};Description: "Launch application3"; WorkingDir: "{app}"; Flags: postinstall nowait skipifsilent runascurrentuser
Error: CreateProcess failed; code 740. The requested operation requires elevation
Filename: {app}\{#MyAppExeName};Description: "Launch application"; WorkingDir: "{app}"; Flags: nowait postinstall shellexec skipifsilent
This works!
For the 32-bit version of the software where the installation is done in 32-bit mode running postinstall with "shellexec" from the SysWOW64 directory it works.
Any thoughts?
Ed