I think the var $TEMPLATES does not provide the correct result.
It should provide the user's temporary directory, which is:
C:\users\user\AppData\Roaming\Microsoft\Templates
But it delivers:
C:\users\user\AppData\Roaming\Microsoft\Windows\Templates
Checking if $TEMPLATES exists
18 posts
What makes you think it is wrong?
NSIS just returns the result of a shell folder function.
NSIS just returns the result of a shell folder function.
so a windows error.
MS\Windows\Templates
does not exist.
File should actually come up with an error.
Can you catch file errors?
MS\Windows\Templates
does not exist.
File should actually come up with an error.
Can you catch file errors?
Windows version?
Win10
NSIS does a little attempt to create the folder but it is expected that your code looks like this:
SetOutPath $TEMPLATES ; Calls CreateDirectoryIf you do "SetOverwrite try" then File will not give any errors.
File MyTemplate.ext
overwrite ist Default, on.
Could you maybe add some example code?
it's so simple
SetoutPath $Templates
File any.exe
Problem is,
Templates Path not exist
-> no error
SetoutPath $Templates
File any.exe
Problem is,
Templates Path not exist
-> no error
SetOutPath $TemplatesWorks just fine for me on Win10.
File "${__FILE__}"
MessageBox mb_ok "Go check $Templates"
Delete "$Templates\${__FILE__}"
Perhaps your profile is locked down somehow? Try Process Monitor and see why it fails to create the directory.
And if I do:
SetOutPath $tempI get a retry/abort/ignore messagebox.
StrCpy $OutDir "$temp\doesnotexist"
File "${__FILE__}"
what do you mean by works well?
The path MS \ Windows \ Templates doesn't exist, so it can't work well !?
The path MS \ Windows \ Templates doesn't exist, so it can't work well !?
SetOutPath $Templates will create it. If that somehow fails on your system then there is something strange with the ACLs in your profile.
What does the detail log on your instfiles page say?
What does the detail log on your instfiles page say?
To be honest, I still haven't figured out where to find the detail log.
Nothing can be broken with my profile, everything works perfectly.
In addition, the directory should not be created at all. I Wish a Error If not exist.
Nothing can be broken with my profile, everything works perfectly.
In addition, the directory should not be created at all. I Wish a Error If not exist.
Well, then I don't understand what you want. The directory has to exist if you want to extract a file there.
yes
IfFileExists
ist usable
ist usable
IfFileExists "$templates\*" ...but it makes no sense to check. Not all of the special folders exist by default, you just create the folder if you are installing a template file.
ok thanks for your efforts!