I want my 7-zip self-extracting archive to run a PowerShell script after it extracts files. To do that, I use method described here: http://www.sphaero.org/blog:2011:0504_7zip_self_extracting_autostart_exe
After file extraction I want to run a powershell script, so here is my config.txt file contents:
;!@Install@!UTF-8! RunProgram="InstallCU.bat" ;!@InstallEnd@!
The InstallCU.bat file launches PowerShell:
powershell.exe -ExecutionPolicy Unrestricted -File InstallCU.ps1
Inside the powershell script I do many things, including checking some registry keys under this branch:
using Test-Path and Get-ItemProperty cmd-lets
I didn't test it out, but I think on 32-bit computers everything will run fine.
My problem is that on 64-bit systems, 32-bit (x86) version of the PowerShell launches. When I access any path in registry under HKLM:\Software in it, it is being redirected to HKLM:\Software\Wow6432Node\ and, of course, fails to find the information I need (because it is in the 64-bit registry branch)
1) How do I make 64-bit 7-zip SFX?
2) How do I run 64-bit PowerShell from 32-bit SFX?
3) How do I read 64-bit registry (not Wow6432Node) via 32-bit powershell? (Though I think that's either impossible or will greatly increase the amount of PowerShell code)
Any other suggestions?