Archive: File not uninstalled


File not uninstalled
I've got an uninstallation which isn't removing all the files.

The uninstallation part of my NSIS script has:

Delete "$INSTDIR\samples\Toolkit Test Suite\Tests\ExampleDefaultData.class"
Delete "$INSTDIR\samples\Toolkit Test Suite\Tests\ExampleDefaultData$ItemDataPair.class"
Delete "$INSTDIR\samples\Toolkit Test Suite\Tests\ExampleDefaultData$1.class"

along with various other files.

The ExampleDefaultData$1.class is not being removed by the uninstaller.

I'm guessing it's something to do with the "$1", but I've been unable to track it down.

Thanks for your help!
Calum


$1 is a token that represents a variable in NSIS. Since NSIS supports inline variables (like with $INSTDIR), $1 will be replaced by the contents of that variable.

To work around the issue, you can use a wildcard to delete. The safest would probably be to put a question mark in place of the $.


If name of your file exactly "ExampleDefaultData$1.class":

Delete "$INSTDIR\samples\Toolkit Test Suite\Tests\ExampleDefaultData$$1.class"

Thanks.
I think this works.
When I previously tried it, I put it in for the installed file as well (File /a "...\ExampleDefaultData$$1.class"), but this didn't work.
Any reason why I need to do it for uninstalling, but not for installing?
Thanks,
Calum


Originally posted by Instructor
If name of your file exactly "ExampleDefaultData$1.class":
Delete "$INSTDIR\samples\Toolkit Test Suite\Tests\ExampleDefaultData$$1.class"

File /a "ExampleDefaultData$1.class"
-It is compile time instruction, so there is no variables (only defines)
Delete "$INSTDIR\ExampleDefaultData$$1.class"
-It is run time instruction