ilaiyaraja
26th June 2013 06:17 UTC
How to select installation Directory based on OS?
By default installation directory I gave this
InstallDir "$PROGRAMFILES\myapplication"
When am i install win 7 64 bit exe installed in C:\Program Files (x86)\myapp instead of C:\program File\myapp.
Same way running win 7 32 bit exe installed in C:\program Files\myapp instead of C:\program Files(x86)\myapp.
I dont know why this variations happening?
Expected result:
win 7 64 bit C:\program Files\myapp
win 7 32 bit C:\program Files (X86)\myapp
I know if we checking some conditions we can change the directory.but why this variations happened?
I hope NSIS default behaviour is based on os it will select the installation directory.
T.Slappy
26th June 2013 07:05 UTC
On 64bit OS the $PROGRAMFILES and $PROGRAMFILES32 constant is mapped to C:\Program Files (x86)\ while $PROGRAMFILES64 points to C:\Program Files
On 32 bit OS the $PROGRAMFILES constant is mapped to C:\Program Files\.
So using $PROGRAMFILES on 32/64bit will give you various paths.
MSG
26th June 2013 07:53 UTC
Originally posted by ilaiyaraja
When am i install win 7 64 bit exe installed in C:\Program Files (x86)\myapp instead of C:\program File\myapp.
NSIS is a 32 bits application, so its $PROGRAMFILES variable will always point to the 32 bits program files folder. On x64 windows, that directory is called "Program Files (x84)". If you want to install a 64 bits application, install it to $PROGRAMFILES64.
Originally posted by ilaiyaraja
Same way running win 7 32 bit exe installed in C:\program Files\myapp instead of C:\program Files(x86)\myapp.
On 32 bits windows, there is no "Program Files(x86)" directory. There is only Program Files.
ilaiyaraja
26th June 2013 10:43 UTC
Thanks MSG.got it Understood the behaviour of NSIS.
MSG
26th June 2013 12:10 UTC
Edit: nvm
T.Slappy
27th June 2013 09:48 UTC
Originally posted by MSG
NSIS is a 32 bits application, so its $PROGRAMFILES variable will always point to the 32 bits program files folder. On x64 windows, that directory is called "Program Files (x84)". If you want to install a 64 bits application, install it to $PROGRAMFILES64.
Here I suppose you mean x64, there is no such directory as "Program Files (x84)" :D
MSG
27th June 2013 11:11 UTC
Originally posted by T.Slappy
Here I suppose you mean x64, there is no such directory as "Program Files (x84)" :D
Actually I meant x86. :rolleyes: