Skip to content
⌘ NSIS Forum Archive

Use uninstall log with multiple directory levels

2 posts

croceldon#

Use uninstall log with multiple directory levels

Hello,

Like many others, I have tried to use the following solution so that my uninstaller will only install the files that it actually installed in the first place:



However, I'm having problem with directories that are under my main install directory. For example, I have folder called QOCForms that resides under the main install dir, and it contains some pdf files. I cannot get the above solution to get files from that directory.

I have attached my nsi file that I'm trying to use. I always have trouble starting at line number 143. Here's the relevant messages from my compiler:

!insertmacro: File
IfFileExists: "$OUTDIR\*.*" ? +2 :
FileWrite: $OUTDIR\*.*

->$UninstLog
File: "$INSTDIR\Support Files\*.*" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
/oname=outfile one_file_only)
Error in macro File on macroline 3
Error in script "C:\SuperCD75\FarrSuperCD8.nsi" on line 145 -- aborting creation process

I don't understand the part about no files found. There are definitely files in that directory.

Thanks for your help
kichik#
Look at the exact error message. It doesn't only tell you it cannot find the files, it tells you which files. It tells you it cannot find $INSTDIR\Support Files\*.*. The problem is $INSTDIR isn't defined until the installer is actually run. It's a runtime variable which are you using in build time. You shouldn't use $ISNTDIR for ${File}, just like in the example.