Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   InstallDir using $PROGRAMFILES64 (http://forums.winamp.com/showthread.php?t=284184)

ryuthomas 2nd January 2008 02:15

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).

kichik 2nd January 2008 17:37

You probably have the same InstallDirRegKey in both.

ryuthomas 2nd January 2008 22:56

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 :)

Anders 3rd January 2008 01:22

InstallDirRegKey probably reads the registry before .onInit

ryuthomas 4th January 2008 01:41

Hi Andres,

Is it possible to tackle this problem?

Thanks :)

Anders 4th January 2008 05:08

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


All times are GMT. The time now is 04:29.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.