Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 14th, 2012  |  syntax: NullSoft Installer  |  size: 4.78 KB  |  views: 93  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ; Script generated by the HM NIS Edit Script Wizard.
  2.  
  3. ; HM NIS Edit Wizard helper defines
  4. !define PRODUCT_NAME "advanLab"
  5. !define PRODUCT_VERSION ""
  6. !define PRODUCT_PUBLISHER "Laborial"
  7. !define PRODUCT_WEB_SITE "http://www.laborial.com"
  8. !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\bdeadmin.exe"
  9. !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
  10. !define PRODUCT_UNINST_ROOT_KEY "HKLM"
  11.  
  12. ; MUI 1.67 compatible ------
  13. !include "MUI.nsh"
  14. !include nsDialogs.nsh
  15.  
  16. ; MUI Settings
  17. !define MUI_ABORTWARNING
  18. !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
  19. !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
  20.  
  21. ; Welcome page
  22. !insertmacro MUI_PAGE_WELCOME
  23. ; Directory page
  24. !insertmacro MUI_PAGE_DIRECTORY
  25.  
  26. Page components
  27.  
  28. ; Instfiles page
  29. !insertmacro MUI_PAGE_INSTFILES
  30.  
  31. ; selecionar startup
  32. Page custom nsDialogsPage
  33.  
  34. ; Finish page
  35. ;!define MUI_FINISHPAGE_RUN "$INSTDIR\DISK1\setup.exe"
  36. !insertmacro MUI_PAGE_FINISH
  37.  
  38. ; Uninstaller pages
  39. !insertmacro MUI_UNPAGE_INSTFILES
  40.  
  41. ; Language files
  42. !insertmacro MUI_LANGUAGE "English"
  43.  
  44. ; MUI end ------
  45.  
  46. Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  47. OutFile "Setup.exe"
  48. InstallDir "$PROGRAMFILES\Advanlab"
  49. InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
  50. ShowInstDetails show
  51. ShowUnInstDetails show
  52.  
  53. ;-----------------------------------------------------------
  54. ;Copias os ficheiros para o setup.exe. Estes ficheiros são.
  55. ;Indusoft: pasta DISK1
  56. ;FTP Server: FileZilla_Server-0_9_41.exe
  57. ;SQL Server: SQLEXPRWT_x64_ENU.exe
  58.  
  59. Section "Advanlab" SEC01
  60.   SetOutPath "$INSTDIR\DISK1"
  61.   SetOverwrite try
  62.   ;File /r DISK1\* ;
  63.   ExecWait "$INSTDIR\DISK1\setup.exe"
  64.   RMDir /r "$INSTDIR\DISK1\"
  65. SectionEnd
  66.  
  67. Section "FTP Server" SEC02
  68.   SetOutPath "$INSTDIR\Prerequisites"
  69.   ;File "Prerequisites\FileZilla_Server-0_9_41.exe"
  70.   ExecWait "$INSTDIR\Prerequisites\FileZilla_Server-0_9_41.exe"
  71.   Delete "$INSTDIR\Prerequisites\FileZilla_Server-0_9_41.exe"
  72. SectionEnd
  73.  
  74. Section "SQL Server" SEC03
  75.   SetOutPath "$INSTDIR\Prerequisites"
  76.   ;File "Prerequisites\SQLEXPRWT_x86_ENU.exe"
  77.   ExecWait "$INSTDIR\Prerequisites\SQLEXPRWT_x86_ENU.exe"
  78.   Delete "$INSTDIR\Prerequisites\SQLEXPRWT_x86_ENU.exe"
  79. SectionEnd
  80.  
  81. Section -AdditionalIcons
  82.   WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
  83.   CreateDirectory "$SMPROGRAMS\Advanlab"
  84. SectionEnd
  85.  
  86. Section -Post
  87.   WriteUninstaller "$INSTDIR\uninst.exe"
  88.   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\DISK1\Common\Borland Shared\BDE\bdeadmin.exe"
  89.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  90.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  91.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\DISK1\Common\Borland Shared\BDE\bdeadmin.exe"
  92.   ;WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  93.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  94.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
  95. SectionEnd
  96.  
  97. Var Dialog
  98. Var Text
  99.  
  100. Function nsDialogsPage
  101.  
  102.         IfFileExists "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe" StartUpExists PastStartUpExists
  103.           StartUpExists:
  104.             ${NSD_CreateText} 2
  105.             StrCpy $2 "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe"
  106.             goto end_of_test
  107.  
  108.           PastStartUpExists:
  109.             nsDialogs::Create 1018
  110.             Pop $Dialog
  111.             nsDialogs::SelectFileDialog open "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe" "*.exe"
  112.             Pop $Text
  113.             ${NSD_CreateText} 2 13u 100% -13u $Text
  114.             Pop $Text
  115.             ${NSD_GetText} $Text $2
  116.             goto end_of_test
  117.  
  118.           end_of_test:
  119.             ;MessageBox MB_OK "1: $2"
  120.             CreateShortCut "$SMPROGRAMS\Advanlab\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
  121.             CreateShortCut "$SMPROGRAMS\Advanlab\Uninstall.lnk" "$INSTDIR\uninst.exe"
  122.             CreateShortCut "$SMPROGRAMS\Advanlab\Advanlab.lnk" "$2"
  123.             CreateShortCut "$DESKTOP\Advanlab.lnk" "$2"
  124.  
  125. FunctionEnd
  126.  
  127.  
  128. Function un.onUninstSuccess
  129.   HideWindow
  130.   MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
  131. FunctionEnd
  132.  
  133. Function un.onInit
  134.   MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
  135.   Abort
  136. FunctionEnd
  137.  
  138. Section Uninstall
  139.   RMDir /r "$INSTDIR"
  140.  
  141.   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  142.   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  143.   SetAutoClose true
  144. SectionEnd