replaced abort() with EG_BUG
[engrid.git] / src / engrid.nsi
blob620d54163277902e588b1068e029235cb6309f30
1 ; Script generated by the HM NIS Edit Script Wizard.
2 !define MINGWBINDIR "c:\qt\2009.03\mingw\bin"
3 !define QTBINDIR "c:\qt\2009.03\qt\bin"
4 !define VTKBINDIR "c:\Libraries\vtk-5.4.2-install\bin"
6 ;!define QTDIR "C:\Qt\4.4.0"
8 ; HM NIS Edit Wizard helper defines
9 !define PRODUCT_NAME "enGrid"
10 !define PRODUCT_VERSION "1.0"
11 !define PRODUCT_PUBLISHER "enGits GmbH"
12 !define PRODUCT_WEB_SITE "http://www.engits.com"
13 !define PRODUCT_DIR_REGKEY "Software\enGits\${PRODUCT_NAME}"
14 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
15 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
17 ; MUI 1.67 compatible ------
18 !include "MUI.nsh"
20 ; MUI Settings
21 !define MUI_ABORTWARNING
22 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
23 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
25 ; Welcome page
26 !insertmacro MUI_PAGE_WELCOME
27 ; License page
28 !insertmacro MUI_PAGE_LICENSE "licence_exe.txt"
29 ; Directory page
30 !insertmacro MUI_PAGE_DIRECTORY
31 ; Instfiles page
32 !insertmacro MUI_PAGE_INSTFILES
33 ; Finish page
34 !define MUI_FINISHPAGE_RUN "$INSTDIR\engrid.exe"
35 !insertmacro MUI_PAGE_FINISH
37 ; Uninstaller pages
38 !insertmacro MUI_UNPAGE_INSTFILES
40 ; Language files
41 !insertmacro MUI_LANGUAGE "English"
43 ; MUI end ------
45 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
46 OutFile "${PRODUCT_NAME}_${PRODUCT_VERSION}_setup.exe"
47 InstallDir "$PROGRAMFILES\enGits\enGrid"
48 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
49 ShowInstDetails show
50 ShowUnInstDetails show
52 Section "MainSection" SEC01
53 SetOutPath "$INSTDIR"
54 SetOverwrite ifnewer
55 File "release\engrid.exe"
56 File "licence.txt"
57 File "license.txt"
58 File "licence_exe.txt"
59 ;File "..\enGrid_0.9.tar.gz"
61 ;install libraries
62 !include libraries_install.nsh
64 ;File "${QTDIR}\bin\QtCore4.dll"
65 ;File "${QTDIR}\bin\QtGui4.dll"
66 ;File "${QTDIR}\bin\QtXml4.dll"
67 ;File "${QTDIR}\bin\QtXmld4.dll"
68 ;File "${QTDIR}\bin\QtNetwork4.dll"
69 ;File "C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\*"
71 CreateDirectory "$SMPROGRAMS\enGrid"
72 CreateShortCut "$SMPROGRAMS\enGrid\enGrid.lnk" "$INSTDIR\engrid.exe" " " "$INSTDIR\G.ico"
73 CreateShortCut "$DESKTOP\enGrid.lnk" "$INSTDIR\engrid.exe" " " "$INSTDIR\G.ico"
74 File "resources\icons\G.ico"
75 SectionEnd
77 Section -AdditionalIcons
78 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
79 CreateShortCut "$SMPROGRAMS\enGrid\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
80 CreateShortCut "$SMPROGRAMS\enGrid\Uninstall.lnk" "$INSTDIR\uninst.exe"
81 SectionEnd
83 Section -Post
84 WriteUninstaller "$INSTDIR\uninst.exe"
85 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\engrid.exe"
86 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
87 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
88 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\engrid.exe"
89 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
90 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
91 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
92 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" "$INSTDIR"
93 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${PRODUCT_VERSION}"
94 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "tmp_directory" "$TEMP"
95 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "working_directory" "$DOCUMENTS"
96 SectionEnd
99 Function un.onUninstSuccess
100 HideWindow
101 MessageBox MB_ICONINFORMATION|MB_OK "enGrid was successfully removed from your computer."
102 FunctionEnd
104 Function un.onInit
105 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove enGrid and all of its components?" IDYES +2
106 Abort
107 FunctionEnd
109 Section Uninstall
110 Delete "$INSTDIR\${PRODUCT_NAME}.url"
111 Delete "$INSTDIR\uninst.exe"
112 Delete "$INSTDIR\G.ico"
113 Delete "$INSTDIR\engrid.exe"
115 Delete "$SMPROGRAMS\enGrid\Uninstall.lnk"
116 Delete "$SMPROGRAMS\enGrid\Website.lnk"
117 Delete "$DESKTOP\enGrid.lnk"
118 Delete "$SMPROGRAMS\enGrid\enGrid.lnk"
120 ;uninstall libraries
121 !include libraries_uninstall.nsh
123 RMDir "$SMPROGRAMS\enGrid"
124 RMDir "$INSTDIR"
126 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
127 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
128 SetAutoClose true
129 SectionEnd