How to get a directory deleted *after* executing a file?
Okay, I want to do the following: Install a bunch of files to a certain directory, and then at the end of the install it executes a file that compiles certain files and copies others. After the executable is done that, I want to remove the directories that the executable copied/compiled the files from. However I tried using the following nsi script:
# [Installer Attributes]
Name "Norse Mini Mod"
OutFile "norseinstaller.exe"
Caption "Norse Mini Mod Setup"
BrandingText ""
# [Additional Installer Settings ]
ShowInstDetails show
AutoCloseWindow false
SilentInstall normal
CRCCheck on
SetCompress auto
SetDatablockOptimize on
SetOverwrite on
# [Background Gradient]
BGGradient 808000 804040 FFFFFF
# [Files]
Section "default"
SetOutPath $INSTDIR
File /r "C:\Program Files\Black Isle\BGII - SoA\norsemod"
File "C:\Program Files\Black Isle\BGII - SOA\NorseSetup.exe"
SectionEnd
# [Directory Selection]
InstallDir "$PROGRAMFILES\Black Isle\BGII - SOA"
# [Registry Get]
InstallDirRegKey HKLM \
"Software\Microsoft\Windows\CurrentVersion\App Paths\BG2Main.Exe" \
"Path"
DirShow show
DirText "Select your default BGII - SoA directory."
;called when the installer is nearly finished initializing
Function .onInit
;message box
MessageBox MB_YESNO "This will install the Norse Mini Mod. Continue?" IDYES NoAbort
Abort
NoAbort:
FunctionEnd
;called when the user hits the 'cancel' button
Function .onUserAbort
MessageBox MB_YESNO "Abort install?" IDYES NoCancelAbort
Abort
NoCancelAbort:
FunctionEnd
;called when the install was successful
Function .onInstSuccess
CreateDirectory "$INSTDIR\backup"
Exec "$INSTDIR\NorseSetup.exe norsemod/norsemod.tp2 --tlkout dialog.tlk"
RMDir /r "$INSTDIR\norsemod"
Delete "$INSTDIR\norsesetup.debug"
FunctionEnd
#eof!
And it runs the executable at the end, howvever it deletes the directory before the executable can compile/copy the files to the appropriate directories...
Any thoughts on how to do this?
Thanx in advance.