Advertisement
Guest User

Untitled

a guest
Sep 14th, 2012
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
  51. ShowInstDetails show
  52. ShowUnInstDetails show
  53.  
  54. ;-----------------------------------------------------------
  55. ;Copias os ficheiros para o setup.exe. Estes ficheiros são.
  56. ;Indusoft: pasta DISK1
  57. ;FTP Server: FileZilla_Server-0_9_41.exe
  58. ;SQL Server: SQLEXPRWT_x64_ENU.exe
  59.  
  60. Section "Advanlab" SEC01
  61.   SetOutPath "$INSTDIR\DISK1"
  62.   SetOverwrite try
  63.   ;File /r DISK1\* ;
  64.   ExecWait "$INSTDIR\DISK1\setup.exe"
  65.   RMDir /r "$INSTDIR\DISK1\"
  66. SectionEnd
  67.  
  68. Section "FTP Server" SEC02
  69.   SetOutPath "$INSTDIR\Prerequisites"
  70.   ;File "Prerequisites\FileZilla_Server-0_9_41.exe"
  71.   ExecWait "$INSTDIR\Prerequisites\FileZilla_Server-0_9_41.exe"
  72.   Delete "$INSTDIR\Prerequisites\FileZilla_Server-0_9_41.exe"
  73. SectionEnd
  74.  
  75. Section "SQL Server" SEC03
  76.   SetOutPath "$INSTDIR\Prerequisites"
  77.   ;File "Prerequisites\SQLEXPRWT_x86_ENU.exe"
  78.   ExecWait "$INSTDIR\Prerequisites\SQLEXPRWT_x86_ENU.exe"
  79.   Delete "$INSTDIR\Prerequisites\SQLEXPRWT_x86_ENU.exe"
  80. SectionEnd
  81.  
  82. Section -AdditionalIcons
  83.   WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
  84.   CreateDirectory "$SMPROGRAMS\Advanlab"
  85. SectionEnd
  86.  
  87. Section -Post
  88.   WriteUninstaller "$INSTDIR\uninst.exe"
  89.   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\DISK1\Common\Borland Shared\BDE\bdeadmin.exe"
  90.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  91.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  92.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\DISK1\Common\Borland Shared\BDE\bdeadmin.exe"
  93.   ;WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  94.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  95.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
  96. SectionEnd
  97.  
  98. Var Dialog
  99. Var Text
  100.  
  101. Function nsDialogsPage
  102.  
  103.     IfFileExists "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe" StartUpExists PastStartUpExists
  104.           StartUpExists:
  105.             ${NSD_CreateText} 2
  106.             StrCpy $2 "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe"
  107.             goto end_of_test
  108.  
  109.           PastStartUpExists:
  110.             nsDialogs::Create 1018
  111.         Pop $Dialog
  112.             nsDialogs::SelectFileDialog open "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe" "*.exe"
  113.         Pop $Text
  114.         ${NSD_CreateText} 2 13u 100% -13u $Text
  115.         Pop $Text
  116.         ${NSD_GetText} $Text $2
  117.         goto end_of_test
  118.  
  119.           end_of_test:
  120.             ;MessageBox MB_OK "1: $2"
  121.             CreateShortCut "$SMPROGRAMS\Advanlab\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
  122.             CreateShortCut "$SMPROGRAMS\Advanlab\Uninstall.lnk" "$INSTDIR\uninst.exe"
  123.             CreateShortCut "$SMPROGRAMS\Advanlab\Advanlab.lnk" "$2"
  124.             CreateShortCut "$DESKTOP\Advanlab.lnk" "$2"
  125.  
  126. FunctionEnd
  127.  
  128.  
  129. Function un.onUninstSuccess
  130.   HideWindow
  131.   MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
  132. FunctionEnd
  133.  
  134. Function un.onInit
  135.   MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
  136.   Abort
  137. FunctionEnd
  138.  
  139. Section Uninstall
  140.   RMDir /r "$INSTDIR"
  141.  
  142.   Delete "$SMPROGRAMS\Advanlab\Uninstall.lnk"
  143.   Delete "$SMPROGRAMS\Advanlab\Website.lnk"
  144.   Delete "$SMPROGRAMS\Advanlab\Advanlab.lnk"
  145.   Delete "$DESKTOP\Advanlab.lnk"
  146.  
  147.   RMDir "$SMPROGRAMS\Advanlab"
  148.  
  149.   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  150.   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  151.   SetAutoClose true
  152. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement