Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Script generated by the HM NIS Edit Script Wizard.
- ; HM NIS Edit Wizard helper defines
- !define PRODUCT_NAME "advanLab"
- !define PRODUCT_VERSION ""
- !define PRODUCT_PUBLISHER "Laborial"
- !define PRODUCT_WEB_SITE "http://www.laborial.com"
- !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\bdeadmin.exe"
- !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
- !define PRODUCT_UNINST_ROOT_KEY "HKLM"
- ; MUI 1.67 compatible ------
- !include "MUI.nsh"
- !include nsDialogs.nsh
- ; MUI Settings
- !define MUI_ABORTWARNING
- !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
- !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
- ; Welcome page
- !insertmacro MUI_PAGE_WELCOME
- ; Directory page
- !insertmacro MUI_PAGE_DIRECTORY
- Page components
- ; Instfiles page
- !insertmacro MUI_PAGE_INSTFILES
- ; selecionar startup
- Page custom nsDialogsPage
- ; Finish page
- ;!define MUI_FINISHPAGE_RUN "$INSTDIR\DISK1\setup.exe"
- !insertmacro MUI_PAGE_FINISH
- ; Uninstaller pages
- !insertmacro MUI_UNPAGE_INSTFILES
- ; Language files
- !insertmacro MUI_LANGUAGE "English"
- ; MUI end ------
- Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
- OutFile "Setup.exe"
- InstallDir "$PROGRAMFILES\Advanlab"
- InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
- ShowInstDetails show
- ShowUnInstDetails show
- ;-----------------------------------------------------------
- ;Copias os ficheiros para o setup.exe. Estes ficheiros são.
- ;Indusoft: pasta DISK1
- ;FTP Server: FileZilla_Server-0_9_41.exe
- ;SQL Server: SQLEXPRWT_x64_ENU.exe
- Section "Advanlab" SEC01
- SetOutPath "$INSTDIR\DISK1"
- SetOverwrite try
- ;File /r DISK1\* ;
- ExecWait "$INSTDIR\DISK1\setup.exe"
- RMDir /r "$INSTDIR\DISK1\"
- SectionEnd
- Section "FTP Server" SEC02
- SetOutPath "$INSTDIR\Prerequisites"
- ;File "Prerequisites\FileZilla_Server-0_9_41.exe"
- ExecWait "$INSTDIR\Prerequisites\FileZilla_Server-0_9_41.exe"
- Delete "$INSTDIR\Prerequisites\FileZilla_Server-0_9_41.exe"
- SectionEnd
- Section "SQL Server" SEC03
- SetOutPath "$INSTDIR\Prerequisites"
- ;File "Prerequisites\SQLEXPRWT_x86_ENU.exe"
- ExecWait "$INSTDIR\Prerequisites\SQLEXPRWT_x86_ENU.exe"
- Delete "$INSTDIR\Prerequisites\SQLEXPRWT_x86_ENU.exe"
- SectionEnd
- Section -AdditionalIcons
- WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
- CreateDirectory "$SMPROGRAMS\Advanlab"
- SectionEnd
- Section -Post
- WriteUninstaller "$INSTDIR\uninst.exe"
- WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\DISK1\Common\Borland Shared\BDE\bdeadmin.exe"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\DISK1\Common\Borland Shared\BDE\bdeadmin.exe"
- ;WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
- SectionEnd
- Var Dialog
- Var Text
- Function nsDialogsPage
- IfFileExists "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe" StartUpExists PastStartUpExists
- StartUpExists:
- ${NSD_CreateText} 2
- StrCpy $2 "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe"
- goto end_of_test
- PastStartUpExists:
- nsDialogs::Create 1018
- Pop $Dialog
- nsDialogs::SelectFileDialog open "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe" "*.exe"
- Pop $Text
- ${NSD_CreateText} 2 13u 100% -13u $Text
- Pop $Text
- ${NSD_GetText} $Text $2
- goto end_of_test
- end_of_test:
- ;MessageBox MB_OK "1: $2"
- CreateShortCut "$SMPROGRAMS\Advanlab\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
- CreateShortCut "$SMPROGRAMS\Advanlab\Uninstall.lnk" "$INSTDIR\uninst.exe"
- CreateShortCut "$SMPROGRAMS\Advanlab\Advanlab.lnk" "$2"
- CreateShortCut "$DESKTOP\Advanlab.lnk" "$2"
- FunctionEnd
- Function un.onUninstSuccess
- HideWindow
- MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
- FunctionEnd
- Function un.onInit
- MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
- Abort
- FunctionEnd
- Section Uninstall
- RMDir /r "$INSTDIR"
- DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
- SetAutoClose true
- SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement