Archive: Global Variable .on & un.


Global Variable .on & un.
Name "Test"
OutFile "setup.exe"
Var /GLOBAL version

!define MUI_CUSTOMFUNCTION_GUIINIT GUIInit
!define MUI_CUSTOMFUNCTION_UNGUIINIT un.GUIInit

Funtion .onInit
IntOp $version 0 + 1
FunctionEnd

Function GUIInit
MessageBox MB_OK $version //$version = 1
FunctionEnd

Function un.onInit
MessageBox MB_OK $version //$version = null
FunctionEnd

Function un.GUIInit
MessageBox MB_OK $version //$version = null
FunctionEnd

how to exec setup.exe new install
.onInit -> GUIInit

how to exec setup.exe ready installed
.onInit -> un.onInit -> un.GUIInit

$varsion initialize in .onInit
how to use $version in un.onInit this case ...


Variable values aren't shared between the installer and the uninstaller. You must save the required values somewhere, like in the registry or in a file.


thank you.