home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hackers Magazine 57
/
CdHackersMagazineNr57.iso
/
Software
/
Programming
/
nsis-2.46-setup.exe
/
Examples
/
UserVars.nsi
< prev
next >
Wrap
Text File
|
2008-02-03
|
1KB
|
70 lines
; UserVars.nsi
;
; This script shows you how to declare and user variables.
;--------------------------------
Name "User Variables Text"
OutFile "UserVars.exe"
InstallDir "$PROGRAMFILES\User Variables Test"
RequestExecutionLevel admin
;--------------------------------
;Pages
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
; Declaration of user variables (Var command), allowed charaters for variables names : [a-z][A-Z][0-9] and '_'
Var "Name"
Var "Serial"
Var "Info"
;--------------------------------
; Installer
Section "Dummy Section" SecDummy
StrCpy $0 "Admin"
StrCpy "$Name" $0
StrCpy "$Serial" "12345"
MessageBox MB_OK "User Name: $Name $\n$\nSerial Number: $Serial"
CreateDirectory $INSTDIR
WriteUninstaller "$INSTDIR\Uninst.exe"
SectionEnd
Section "Another Section"
Var /GLOBAL "AnotherVar"
StrCpy $AnotherVar "test"
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
StrCpy $Info "User variables test uninstalled successfully."
Delete "$INSTDIR\Uninst.exe"
RmDir $INSTDIR
SectionEnd
Function un.OnUninstSuccess
HideWindow
MessageBox MB_OK "$Info"
FunctionEnd