Old 2nd January 2008, 03:15   #1
ryuthomas
Junior Member
 
Join Date: Dec 2007
Posts: 9
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).
ryuthomas is offline   Reply With Quote
Old 2nd January 2008, 18:37   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You probably have the same InstallDirRegKey in both.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 2nd January 2008, 23:56   #3
ryuthomas
Junior Member
 
Join Date: Dec 2007
Posts: 9
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
ryuthomas is offline   Reply With Quote
Old 3rd January 2008, 02:22   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,538
InstallDirRegKey probably reads the registry before .onInit

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 4th January 2008, 02:41   #5
ryuthomas
Junior Member
 
Join Date: Dec 2007
Posts: 9
Hi Andres,

Is it possible to tackle this problem?

Thanks
ryuthomas is offline   Reply With Quote
Old 4th January 2008, 06:08   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,538
read from the registry yourself in .onInit, don't use InstallDirRegKey

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump