un.onInst
I'm getting the following error in my script upon compile:
Function: "un.onInit"
Call must be used with function names starting with "un." in the uninstall section.
Usage: Call function_name | [:label_name]
The code that it's crashing on is below howver I'll just briefly explain what I'm doing. For both the installer and uninstaller I want it to call the function KillProgramExe to terminate the running program before its file is updated or so it can be delted upon uinstallation.
What is causing this bug?
Code below:
;**************************************************************************************************
;FUNCTION - ONINIT
;**************************************************************************************************
Function .onInit
;Check if the program exe is running before proceeding installation
Call KillProgramExe
SetOutPath $TEMP
File /oname=spltmp.bmp "Images\splash.bmp"
; optional
; File /oname=spltmp.wav "Data\splash.wav"
splash::show 1000 $TEMP\spltmp
Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normal, and '-1' if some error occured.
Delete $TEMP\spltmp.bmp
; Delete $TEMP\spltmp.wav
FunctionEnd
;**************************************************************************************************
;FUNCTION - UN.ONINIT
;**************************************************************************************************
Function un.onInit
;Check if the program exe is running before proceeding uninstallation
Call KillProgramExe
FunctionEnd
;**************************************************************************************************
;FUNCTION - KillProgramExe
;**************************************************************************************************
Function KillProgramExe
FindProcDLL::FindProc "${MUI_PROGRAM_FILENAME}.exe"
StrCmp $R0 1 foundexe notfoundexe
foundexe:
KillProcDLL::KillProc "${MUI_PROGRAM_FILENAME}.exe"
notfoundexe:
;MessageBox MB_OK "Program is not running"
FunctionEnd