![]() |
#1 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
Checking if $TEMPLATES exists
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 |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
What makes you think it is wrong?
NSIS just returns the result of a shell folder function. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
so a windows error.
MS\Windows\Templates does not exist. File should actually come up with an error. Can you catch file errors? |
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Windows version?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
Win10
|
![]() |
![]() |
![]() |
#6 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
NSIS does a little attempt to create the folder but it is expected that your code looks like this:
Quote:
IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
overwrite ist Default, on.
|
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Could you maybe add some example code?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
it's so simple
SetoutPath $Templates File any.exe Problem is, Templates Path not exist -> no error |
![]() |
![]() |
![]() |
#10 | ||
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Quote:
Perhaps your profile is locked down somehow? Try Process Monitor and see why it fails to create the directory. And if I do: Quote:
IntOp $PostCount $PostCount + 1 |
||
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
what do you mean by works well?
The path MS \ Windows \ Templates doesn't exist, so it can't work well !? |
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
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? IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#13 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
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. |
![]() |
![]() |
![]() |
#14 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Well, then I don't understand what you want. The directory has to exist if you want to extract a file there.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#15 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
yes
|
![]() |
![]() |
![]() |
#16 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
IfFileExists
ist usable |
![]() |
![]() |
![]() |
#17 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Quote:
IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#18 |
Junior Member
Join Date: Apr 2020
Posts: 22
|
ok thanks for your efforts!
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|