Archive: InstallDir using $PROGRAMFILES64


InstallDir using $PROGRAMFILES64
Hi,

I have two installers for my application, 1 for 32bit and 1 for 64bit.

For 64bit, I am using:
InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}"
and put
SetRegView 64
in function .onInit

For 32bit, I am using:
InstallDir "$PROGRAMFILES\${COMPANYNAME}\${APPNAME}"
and put
SetRegView 32
in function .onInit

After I build my installer, I test the installation in this following order:
1. Run 32bit installer
2. Run 64bit installer.

When I run 64bit installer, the default installation directory is:
C:\Program Files (x86)\MyCompany\MyApplication

If I uninstall the 32bit application and re-run the 64bit installer, and then the default directory is correct:
C:\Program Files\MyCompany\MyApplication

Any idea why?

Cheers :)

PS.
If I run 64bit installer first, the default directory is correct (C:\Program Files\MyCompany\MyApplication).

I also checked 32bit installer after run 64bit installer and the default directory is also right (C:\Program Files (x86)\MyCompany\MyApplication).


You probably have the same InstallDirRegKey in both.


Hi Kichik,

I do have InstallDirRegKey the same on both installer:
InstallDirRegKey HKLM "Software\${COMPANYNAME}\${APPNAME}" ""

But, I thought when I do "SetRegView 64" on .onInit function, it will automatically uses 64 bit Registry.

So, in this case, when I do "SetRegView 32" (for 32 bit installer), the registry will be put in:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyApp

Whereas in for "SetRegView 64" (for 64 bit installer), the registry will be put in:
HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\MyApp

Is my assumption right?

Thank for your help again.

Cheers :)


InstallDirRegKey probably reads the registry before .onInit


Hi Andres,

Is it possible to tackle this problem?

Thanks :)


read from the registry yourself in .onInit, don't use InstallDirRegKey