I am trying to create an exe file using NSIS script, in my script i am copying a batch file and a folder inside the already installed Jasper Server directory(It could be any directory)
This is my NSIS script–
* Section
SetOutPath "C:\PROGRA~2\JASPER~1.0\buildomatic"
File /r "C:\Users\Desktop\K-installer\backup3101"
File "C:\Users\Desktop\K-installer\batch\demo.bat"
ExecWait '"C:\PROGRA~2\JASPER~1.0\buildomatic\demo.bat"'
SectionEnd *
that is working fine when jasper server is installed in Program Files(x86).
How can i generalize it for both Program Files and Program Files(x86).
This might not be super elegant but you can check if the directory “C:\PROGRA~2\JASPER~1.0\buildomatic” exists for “Program Files(x86)” and check if “C:\PROGRA~1\JASPER~1.0\buildomatic” for “Program Files”. Then you can can do individual branching and handle everything according to your needs there.
Here you find how:
http://nsis.sourceforge.net/IfFileExists_Changes_Section_Flags
I hope this has helped you.
Edit: You might want to try something like this (warning not tested):