![]() |
#1 |
Junior Member
Join Date: Oct 2006
Location: Poland
Posts: 22
|
One installer for 32bit and 64bit
I'm creating installer which will contain components for 32 and 64 bit systems. There is no problem with copying correct files, but I don't know how to define INSTDIR and InstallDir. Can someone tell me how to set INSTDIR and InstallDir depending on Windows architecture (i.e. in .oninit)?
|
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
You want to use x64.nsh. (This question has been asked dozens of times before. Please search before you ask.)
|
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Oct 2006
Location: Poland
Posts: 22
|
Yes, I have searched, but as far as I remember it doesn't worked for InstallDir?
|
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
InstallDir is a compiletime command. If you're setting $INSTDIR in .onInit anyway, using it is pointless.
This is probably all you have to do: code: |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Oct 2006
Location: Poland
Posts: 22
|
Thanks. But should it be in .oninit or can be in other function which I have (also it is question for sysdir) - I give 64bit user page where he have choice to install 32bit or either 64bit version. Choice is because it installs some component for browsers and because i.e. firefox officially is not 64bit (and user likes to use ff) he can install 32bit version.
|
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
If it is system32/syswow64 then you don't need to change the actual value of $INSTDIR and just use the DisableX64FSRedirection/EnableX64FSRedirection macros from x64.nsh. For other paths not dependent on x64 file system redirection then you need to change $OUTDIR (SetOutPath) accordingly. And no it doesn't need to be in .onInit - if you do change $INSTDIR it needs to be before the Directory page of course (if you are using it).
Stu |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Oct 2006
Location: Poland
Posts: 22
|
Thanks it works fine, but I have to manually set DisableX64FSRedirection/EnableX64FSRedirection each time I want to copy something to $SYSDIR. It don't works when set in .oninit.
|
![]() |
![]() |
![]() |
#8 |
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Should be fine in .onInit unless something else messes with the x64 redirection under your installer process.
just as an aside.. on Vista and above, and XP with a particular by-request hotfix (so I wouldn't depend on it), you can also write to the special SysNative folder, which is the 64bit System folder on 64bit platforms, and simply doesn't exist on 32bit platforms. http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx |
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Oct 2006
Location: Poland
Posts: 22
|
I have strange issue. When user choose whether to install 32 or 64 bit i set variable named arch and based on it I'm copying 32 or 64 bit files. But it works on one test computer and on other two not... What can be wrong? Code for this is below:
code: |
![]() |
![]() |
![]() |
#10 |
Senior Member
Join Date: Nov 2005
Posts: 115
|
What exactly is it doing or not doing (copying wrong file/wrong location/etc)? I would write it like this:
PHP Code:
|
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: Oct 2006
Location: Poland
Posts: 22
|
It doesn't copy this file. I will try to make different functions for 32 and 64 and call them according to arch variable.
What is the purpose of running at the and ${EnableX64FSRedirection} ? Edit: Different functions and calling them according to this variable works ok. Last edited by voyteckst; 30th April 2010 at 08:13. |
![]() |
![]() |
![]() |
#12 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|