Dynamic allocation of needed user variables (exehead grew 512 bytes).

Independed user vars in uninstaller and installer


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2656 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
ramon18 2003-06-17 23:59:13 +00:00
parent 2ff0e96a38
commit ab91077049
10 changed files with 197 additions and 92 deletions

View file

@ -14,12 +14,17 @@
;General
OutFile "UserVars.exe"
ShowInstDetails nevershow
InstallDir "$PROGRAMFILES\Test UserVars"
;--------------------------------
;Pages
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
@ -28,6 +33,7 @@
;--------------------------------
; Declaration of User Variables with command DIM, allowed charaters for variables names : [a-z][A-Z][0-9] and '_'
DIM "un.Info" ; this one can only be used in uninstaller methods
DIM "Name"
DIM "Serial"
@ -39,8 +45,22 @@ Section "Dummy Section" SecCopyUI
StrCpy $0 "Admin"
StrCpy "$Name" $0
StrCpy "$Serial" "12345"
MessageBox MB_OK "User Name: $Name: $\n$\nSerial Number: $Serial"
MessageBox MB_OK "User Name: $Name$\n$\nSerial Number: $Serial"
CreateDirectory $INSTDIR
WriteUninstaller "$INSTDIR\Uninst.exe"
SectionEnd
Function un.OnUninstSuccess
HideWindow
MessageBox MB_OK "$un.Info"
FunctionEnd
Section "Uninstall"
StrCpy $un.Info "${MUI_PRODUCT} ${MUI_VERSION} uninstalled successfully."
Delete "$INSTDIR\Uninst.exe"
RmDir $INSTDIR
SectionEnd