![]() |
#1 |
Junior Member
Join Date: Oct 2021
Posts: 8
|
![]()
Newbie to NSIS, though I've used WinAmp since 1999
![]() C:\Users\CBdeV\Documents\SecureCoop_Windows_app\ But with !echo I found that it is set to (C:\Users\CBdeV\Documents\SecureCoop_Windows_app\setup.nsi:12) As a consequence, operations such as CopyFiles fail. What am I doing wrong? I've attached my .nsi script. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
!echo $EXEDIR makes no sense, you need to learn the difference between compile time and run time and variables vs defines.
You probably want "File", not "CopyFiles". You can't mix "RequestExecutionLevel user" and $Programfiles. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 | |
Junior Member
Join Date: Oct 2021
Posts: 8
|
Quote:
Updated script attached. code: Output from MakeNSISW: code: |
|
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 923
|
It fails when you compile the script because $EXEDIR is only available when you run the installer ie after it's compiled.
Basically, anything with only a '$' in front of it is a runtime variable and cannot be used at compile time. A '${}' (dollar sign with curly braces) is a define which can be set and changed at compile time, can also be used at runtime but is not editable ie readonly. The 'Icon' command is only used during compile time, and because the icon is in the same directory as the script, all you have to do is this: Icon SecureCoop.ico Same with 'UninstallIcon'. The 'File' command refers to the file to include ie where on your machine it is. Whereas 'SetOutPath' controls what directory that file goes into when the installer is run. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Oct 2021
Posts: 8
|
Thank you. So would I copy a large number of files using SetOutPath and File? Tried "${EXEDIR}" and that didn't work, but when I set the path absolutely and explicitly e.g. C:\Users.. that does work. It's a workaround for now.
|
![]() |
![]() |
![]() |
#6 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 923
|
${EXEDIR} doesn't exist because it's not a compile time variable. If you really want to set it (I would not recommend it though because it makes things more ambiguous), use: !define EXEDIR "."
You can use the path relative to the script file, like this: File /r "dist/SecureCoop/*.*" The '/r' flag means recurse into subdirectories too (the default is to stay in the specified directory). Just be aware that any files that don't have a dot in them will be skipped (basically, files with no extension will be skipped). To include all files, use a single wildcard. SetOutPath just changes which directory the files go into, if you need it. PHP Code:
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Oct 2021
Posts: 8
|
Thank you, this did work.
SetOutPath "$INSTDIR" File /r "dist\SecureCoop\*.*" |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|