|
|
|
|
#1 | |
|
Junior Member
Join Date: Jul 2011
Posts: 5
|
Problem with path when building on Windows 7, 64 bit
In building my installer I have to include some files from a 32-bit library located in Program Files. Because my system is a Windows 7 64-bit it searches for the files in "C:\Program Files" instead of "C:\Program Files (X86)".
Currently we use the following code: Quote:
Is there a way to change the hard coded define 'common_files' to something dynamic? I tried to use $COMMONFILES but this is not defined during compilation. |
|
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Try $%COMMONPROGRAMFILES(x86)%
Stu |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2011
Posts: 5
|
Thanks, but COMMONPROGRAMFILES(x86) is an environment variable that I don't think is available on XP. So how to create an easy but universal script for compilation? During Installation there are the convenient NSIS Constants, but I didn't manage to get those working during compilation. Any tips?
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Apr 2008
Posts: 21
|
did you use > $%COMMONPROGRAMFILES(x86)% < as AfrowUK mentioned?
this will get the compillertime path for the C:\Program Files (x86)\Common Files on 64bit OS and C:\Program Files\Common Files on 32bit OS |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jul 2011
Posts: 5
|
Sorry for the delay, but I had to find a machine with XP installed. I resorted to running XP in a virtual machine.
I was correct in assuming that > $%COMMONPROGRAMFILES(x86)% < doesn't work on 32-bit XP, it is an undefined variable on that platform. What does work is the Environment variable > $%COMMONPROGRAMFILES% <. This will give me the desired effect for the compillertime path to C:\Program Files (x86)\Common Files on 64bit OS and C:\Program Files\Common Files on 32bit OS I still don't like it that Compile-time I have to resort to other methods for determining the Environment than during Run-time. An orthogonal command set would make it easier to learn programming NSIS and has the potential of reducing the NSIS code base. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|