Debian Codegraph @

win/qbrew.nsi

raw
1 ; QBrew Win32 Installer Script
2 ; Requires NSIS 2.0 and above
3 ; http://nsis.sf.net
4
5 !define PRODUCT "QBrew"
6 !define VERSION "0.4.1"
7 !define PUBLISHER "Usermode.org"
8 !define WEB_SITE "http://www.usermode.org"
9
10 !include "MUI.nsh"
11
12 ;----------------------------------------
13 ; Configuration
14
15 ; General
16 Name "QBrew"
17 OutFile "qbrew-install.exe"
18
19 ; Folder-selection page
20 InstallDir "$PROGRAMFILES\${PRODUCT}"
21
22 ; Remember install folder
23 InstallDirRegKey HKCU "Software\${PRODUCT}" ""
24
25 ; don't bother with verification or compression
26 CRCCheck off
27 SetCompress off
28
29 ;----------------------------------------
30 ;Interface Settings
31
32 !define MUI_ABORTWARNING
33
34 ;--------------------------------
35 ;Interface Configuration
36
37 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
38 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
39 !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
40 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
41
42 ;----------------------------------------
43 ; Modern UI Configuration
44
45 !insertmacro MUI_PAGE_WELCOME
46 ;!insertmacro MUI_PAGE_LICENSE
47 ;!insertmacro MUI_PAGE_COMPONENTS
48 !insertmacro MUI_PAGE_DIRECTORY
49 !insertmacro MUI_PAGE_INSTFILES
50 ;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\handbook-index.html"
51 !insertmacro MUI_PAGE_FINISH
52 !insertmacro MUI_UNPAGE_CONFIRM
53 !insertmacro MUI_UNPAGE_INSTFILES
54
55 ;------------------------------------------
56 ; Languages
57
58 !insertmacro MUI_LANGUAGE "English"
59
60 ;------------------------------------------
61 ;Installer Sections
62
63 ; Required, installs program files
64 Section "QBrew Program" SecCore
65 SectionIn RO
66 SetShellVarContext all ; modifies 'all users' area of start menu
67 SetOverwrite on
68 SetOutPath $INSTDIR
69
70 ; Files to get
71 File /r "C:\qbrew\*"
72 File "${NSISDIR}\Contrib\UIs\modern.exe"
73
74 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\QBrew" DisplayName "QBrew (remove only)"
75 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\QBrew" UninstallString "$INSTDIR\Uninstall.exe"
76 WriteRegStr HKEY_LOCAL_MACHINE "Software\usermode\QBrew" "InstallDir" $INSTDIR
77 WriteRegStr HKEY_LOCAL_MACHINE "Software\usermode\QBrew" "Version" "${VERSION}"
78 WriteUninstaller "$INSTDIR\Uninstall.exe"
79
80 SectionEnd
81
82 ; Required, start menu shortcuts
83 Section -StartMenu
84 SetShellVarContext all
85 CreateDirectory "$SMPROGRAMS\${PRODUCT}"
86 IfFileExists "$SMPROGRAMS\${PRODUCT}" createIcons
87 SetShellVarContext current
88 CreateDirectory "$SMPROGRAMS\${PRODUCT}"
89
90 createIcons:
91 CreateShortcut "$SMPROGRAMS\${PRODUCT}\QBrew.lnk" "$INSTDIR\qbrew.exe" ;"" $INSTDIR\qbrew.ico
92 CreateShortCut "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
93 CreateShortCut "$SMPROGRAMS\${PRODUCT}\QBrew Handbook.lnk" "$INSTDIR\doc\handbook-index.html"
94 CreateShortcut "$DESKTOP\QBrew.lnk" "$INSTDIR\qbrew.exe" ;"" $INSTDIR\qbrew.ico
95 SectionEnd
96
97 ;------------------------------------------
98 ;Descriptions
99
100 ;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
101 ;!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "QBrew program files. (Required for QBrew to run)"
102 ;!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "Select to add a link to QBrew on your desktop."
103 ;!insertmacro MUI_FUNCTION_DESCRIPTION_END
104
105 ;------------------------------------------
106 ;Uninstaller Section
107 Section "Uninstall"
108 SetShellVarContext all
109
110 Delete "$INSTDIR\modern.exe"
111 Delete "$INSTDIR\Uninstall.exe"
112 RMDir /r "$SMPROGRAMS\${PRODUCT}"
113 Delete "$DESKTOP\QBrew.lnk"
114 RMDir /r "$INSTDIR\doc"
115 Delete "$INSTDIR\LICENSE"
116 Delete "$INSTDIR\README"
117 Delete "$INSTDIR\qbrew.exe"
118 Delete "$INSTDIR\qbrewdata"
119 Delete "$INSTDIR\splash.png"
120 Delete "$INSTDIR\qbrew.ico"
121 Delete "$INSTDIR\mingwm10.dll"
122 Delete "$INSTDIR\QtCore4.dll"
123 Delete "$INSTDIR\QtGui4.dll"
124 RMDir "$INSTDIR"
125
126 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\QBrew"
127 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\usermode\QBrew"
128 SectionEnd
129
130 ;eof