home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Examples / UserVars.nsi < prev    next >
Text File  |  2004-01-04  |  1KB  |  60 lines

  1. ; UserVars.nsi
  2. ;
  3. ; This script shows you how to declare and user variables.
  4.  
  5. ;--------------------------------
  6.  
  7.   Name "User Variables Text"
  8.   OutFile "UserVars.exe"
  9.   
  10.   InstallDir "$PROGRAMFILES\User Variables Test"
  11.   
  12. ;--------------------------------
  13.  
  14.   ;Pages
  15.   Page directory
  16.   Page instfiles
  17.   
  18.   UninstPage uninstConfirm
  19.   UninstPage instfiles
  20.  
  21. ;--------------------------------
  22. ; Declaration of user variables (Var command), allowed charaters for variables names : [a-z][A-Z][0-9] and '_'
  23.  
  24.   Var "Name"
  25.   Var "Serial"
  26.   Var "Info"
  27.  
  28. ;--------------------------------
  29. ; Installer
  30.  
  31. Section "Dummy Section" SecDummy
  32.  
  33.      StrCpy $0 "Admin"
  34.      StrCpy "$Name" $0
  35.      StrCpy "$Serial" "12345"
  36.      MessageBox MB_OK "User Name: $Name $\n$\nSerial Number: $Serial"
  37.  
  38.      CreateDirectory $INSTDIR
  39.      WriteUninstaller "$INSTDIR\Uninst.exe"
  40.      
  41. SectionEnd
  42.  
  43. ;--------------------------------
  44. ; Uninstaller
  45.  
  46. Section "Uninstall"
  47.  
  48.      StrCpy $Info "User variables test uninstalled successfully."
  49.      Delete "$INSTDIR\Uninst.exe"
  50.      RmDir $INSTDIR
  51.  
  52. SectionEnd
  53.  
  54. Function un.OnUninstSuccess
  55.  
  56.      HideWindow
  57.      MessageBox MB_OK "$Info"
  58.      
  59. FunctionEnd
  60.