northwind
2nd November 2013 23:20 UTC
Can't create a directory
Hi guys,
This is my first post.
I try to create a script to build a installation file. I have put the program files under the $INSTDIR\myProgramName\. Then I want to put the license file into a directory under the $APPDATA. There is no error from NSIS, but after installing the program, I found the directory under $APPDATA is not created and the license file can't be installed.
Here is the script snippet:
SetOutPath "$APPDATA\myCompay\myprogram\xx unfold srf"
File "..\testfolders\license.lic"
Could anyone tell me where I should go to find the problem?
I run win7 64bit, but the program should be installed on 32&64, xp, win7 and win8.
thank you
John
Highcoder
3rd November 2013 00:23 UTC
Hello,
I guess you use SetExecutionLevelAdmin?
Where want you to store the license file?
Under SetShellVarContext Current it will be stored under "c:\users\username\appdata\roaming\myCompay\myprogram\xx unfold srf"
Under SetShellVarContext All it will be stored under
"c:\ProgramData\myCompay\myprogram\xx unfold srf"
If you want it in localappdata instead of roaming you should use $LOCALAPPDATA.
And you have a look for compiler warnings. Maybe nothing found under "..\testfolders\license.lic" and you have to use the full path instead of the relative one.
cheers
northwind
3rd November 2013 01:57 UTC
highcoders,
thank you for your quick reply. I found the problem, the script is correct, but SetShellVarContext has current as default. I need to use SetShellVarContext all to make it work.
Regards
john