Skip to content
⌘ NSIS Forum Archive

Backup files on install, restore on uninstall

4 posts

DaOmAsTeR#

Backup files on install, restore on uninstall

Hello.
I've found this:


I made two nsh-files with the macro inside and saved them in the include-folder.

My nsi-file:
...
!include "MUI2.nsh"
!include "BackupFile.nsh"
!include "RestoreFile.nsh"
...
SetOutPath "$INSTDIR"
!instermacro BackupFile "$INSTDIR" "example.exe" "$INSTDIR\backup
...
Section "Uninstall"
Delete $INSTDIR\example.exe
!insertmacro RestoreFile "$INSTDIR\backup" "example.exe" "$INSTDIR"
Delete "$INSTDIR\Uninstall.exe"

I get the error:

Error: unterminated string parsing line at C:\Programme\NSIS\Examples\Modern UI\WelcomeFinish.nsi:60 Error in script "C:\Programme\NSIS\Examples\Modern UI\WelcomeFinish.nsi" on line 60 -- aborting creation process

What's wrong?
Thanks
Comperio#
I see this line is missing a closing quote:
!instermacro BackupFile "$INSTDIR" "example.exe" "$INSTDIR\backup
It should be this:
!instermacro BackupFile "$INSTDIR" "example.exe" "$INSTDIR\backup"