2003-07-15 21:26:07 +00:00
|
|
|
; UserVars.nsi
|
2003-06-12 00:06:23 +00:00
|
|
|
;
|
2003-07-15 21:26:07 +00:00
|
|
|
; This script shows you how to declare and user variables.
|
2003-06-12 00:06:23 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
2003-07-15 21:26:07 +00:00
|
|
|
Name "User Variables Text"
|
2003-06-12 00:06:23 +00:00
|
|
|
OutFile "UserVars.exe"
|
2003-07-15 21:26:07 +00:00
|
|
|
|
|
|
|
InstallDir "$PROGRAMFILES\User Variables Test"
|
|
|
|
DirText "Choose a folder to install in which to install the test:" " "
|
2003-06-12 00:06:23 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
2003-07-15 21:26:07 +00:00
|
|
|
; Declaration of user variables (Var command), allowed charaters for variables names : [a-z][A-Z][0-9] and '_'
|
2003-06-12 00:06:23 +00:00
|
|
|
|
2003-07-08 23:18:47 +00:00
|
|
|
Var "Name"
|
|
|
|
Var "Serial"
|
2003-07-15 21:26:07 +00:00
|
|
|
|
|
|
|
Var "un.Info" ; this one can only be used in the uninstaller
|
2003-06-12 00:06:23 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
2003-07-15 21:26:07 +00:00
|
|
|
; Installer
|
2003-06-12 00:06:23 +00:00
|
|
|
|
2003-07-15 21:26:07 +00:00
|
|
|
Section "Dummy Section" SecDummy
|
2003-06-12 00:06:23 +00:00
|
|
|
|
|
|
|
StrCpy $0 "Admin"
|
|
|
|
StrCpy "$Name" $0
|
|
|
|
StrCpy "$Serial" "12345"
|
2003-06-17 23:59:13 +00:00
|
|
|
MessageBox MB_OK "User Name: $Name: $\n$\nSerial Number: $Serial"
|
2003-06-12 00:06:23 +00:00
|
|
|
|
2003-06-17 23:59:13 +00:00
|
|
|
CreateDirectory $INSTDIR
|
|
|
|
WriteUninstaller "$INSTDIR\Uninst.exe"
|
2003-07-15 21:26:07 +00:00
|
|
|
|
2003-06-12 00:06:23 +00:00
|
|
|
SectionEnd
|
|
|
|
|
2003-07-15 21:26:07 +00:00
|
|
|
;--------------------------------
|
|
|
|
; Uninstaller
|
2003-06-17 23:59:13 +00:00
|
|
|
|
|
|
|
Section "Uninstall"
|
|
|
|
|
2003-07-15 21:26:07 +00:00
|
|
|
StrCpy $un.Info "User variables test uninstalled successfully."
|
2003-06-17 23:59:13 +00:00
|
|
|
Delete "$INSTDIR\Uninst.exe"
|
|
|
|
RmDir $INSTDIR
|
|
|
|
|
|
|
|
SectionEnd
|
2003-07-15 21:26:07 +00:00
|
|
|
|
|
|
|
Function un.OnUninstSuccess
|
|
|
|
|
|
|
|
HideWindow
|
|
|
|
MessageBox MB_OK "$un.Info"
|
|
|
|
|
|
|
|
FunctionEnd
|