[SOLVED]Windows Qt Installer Framework add Registry Key during Install
-
Hi,
I am using the qtifw 1.5 and I want to add some registry key's during the install process. I have created an additional package to manage this.
My plan is to add some key's to customize the windows explorer context menu's for *.jpg, *.png and *.bmp files.
My installerscript.qs looks link "this":http://pastebin.com/6tk1WWkj
But I had problems because the arguments of "component.addOperation" must be separated.
Something like this does not work:
component.addOperation("Execute", cmd + "/C ", reg, ...This is working but I get problems because of the 10 args limitation:
component.addOperation("Execute", cmd, "/C", reg, ...Also I have tried to write my "reg add" statements in a addReg.bat batch file and simply execute this file during the install process. With this solution I was able to add some key's. Only key's under HKEY_LOCAL_MACHINE aren't added.
If I execute my batch file from a cmd shell directly all key's are added!!!As you can see I have followed the instructions on "https://bugreports.qt-project.org/browse/QTIFW-576":https://bugreports.qt-project.org/browse/QTIFW-576 already.
Any ideas?
Best regards.
-
I have figured it out :D
The problem is that the installer.exe is a 32bit exe. Therefore any reg key's written to HKEY_LOCAL_MACHINE\SOFTWARE\ is redirected to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node for compatibility reasons.
To overcome this I downloaded the qtifw sources and compiled the sources with mingw64 compiler. Now my installer.exe is a 64bit exe and the reg key's are created correctly.
-
In windows 7, you can use the correct version of reg (windows\system for 64bit, and windows\syswow64 for 32 bits).
In Windows 10, you can use the /reg:32 keys for 32bit and /reg:64 for 64 bits.