Skip to content
Newer
Older
100644 151 lines (107 sloc) 3.84 KB
3a205f7 New nsis file for Qt 4.8
unknown authored May 22, 2012
1 ;NSIS Modern User Interface
2 ;Basic Example Script
3
4 ;--------------------------------
5 ;Include Modern UI
6
7 !include "MUI2.nsh"
8 !include "WinVer.nsh"
9
10 !define MUI_ICON "..\..\librecad\res\main\librecad.ico"
11
12 ;--------------------------------
13 ;General
14
15 ;Name and file
16 Name "LibreCAD"
17 OutFile "LibreCAD-Installer.exe"
18
19 ;Default installation folder
20 InstallDir "$PROGRAMFILES\LibreCAD"
21
22 ;Get installation folder from registry if available
23 InstallDirRegKey HKCU "Software\LibreCAD" ""
24
25 ;Request application pivileges for Windows Vista
26 RequestExecutionLevel admin
27 ;TargetMinimalOS 5.1
28
29 ;--------------------------------
30 ;Interface Settings
31
32 !define MUI_ABORTWARNING
33
34 ;--------------------------------
35 ;Pages
36
37 !insertmacro MUI_PAGE_LICENSE "../../gpl-2.0.txt"
38 !insertmacro MUI_PAGE_DIRECTORY
39 !insertmacro MUI_PAGE_INSTFILES
40
41 !insertmacro MUI_UNPAGE_CONFIRM
42 !insertmacro MUI_UNPAGE_INSTFILES
43
44 ;--------------------------------
45 ;Languages
46
47 !insertmacro MUI_LANGUAGE "English"
48
49
50
51 Function .onInit
52
53 Push $R0
54 Push $R1
55 Push $R2
56
57 ; get acount info into $R2
58 userInfo::getAccountType
59 pop $0
60 StrCpy $R2 $0 5
61
62 ${If} ${IsWin2000}
63 strCmp $R2 "Admin" lbl_checkok
64 messageBox MB_OK "I am sorry, this installer needs Admin priviledges, Please login as an administrator and install the software."
65 Quit
66 ${EndIf}
67
68 ${If} ${IsWinXP}
69 strCmp $R2 "Admin" lbl_checkok
70 messageBox MB_OK "I am sorry, this installer needs Admin priviledges, Please login as an administrator and install the software."
71 Quit
72 ${EndIf}
73
74 lbl_checkok:
75 Pop $R2
76 Pop $R1
77 Pop $R0
78
79 FunctionEnd
80
81 ;--------------------------------
82 ;Installer Sections
83
84 Section "Install Section" SecInstall
85
86 SetOutPath "$INSTDIR"
87 File /r "..\..\windows\*.*"
88 File "C:\QtSDK\mingw\bin\libgcc_s_dw2-1.dll"
89 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\mingwm10.dll"
90 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtCore4.dll"
91 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\Qt3Support4.dll"
92 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtCore4.dll"
93 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtGui4.dll"
94 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtXml4.dll"
95 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtHelp4.dll"
96 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtSql4.dll"
97 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtClucene4.dll"
98 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtNetwork4.dll"
99 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtSvg4.dll"
100 SetOutPath "$INSTDIR\sqldrivers"
101 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\plugins\sqldrivers\qsqlite4.dll"
102 SetOutPath "$INSTDIR\imageformats"
103 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\plugins\imageformats\qgif4.dll"
104 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\plugins\imageformats\qjpeg4.dll"
105 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\plugins\imageformats\qtiff4.dll"
106 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\plugins\imageformats\qmng4.dll"
107 File "C:\QtSDK\Desktop\Qt\4.8.0\mingw\plugins\imageformats\qsvg4.dll"
108
109 ;Store installation folder
110 WriteRegStr HKCU "Software\LibreCAD" "" $INSTDIR
111
112 ;Create uninstaller
113 WriteUninstaller "$INSTDIR\Uninstall.exe"
114
115 ; create shortcuts
116 createShortCut "$DESKTOP\LibreCAD.lnk" "$INSTDIR\LibreCAD.exe"
117
118 ; Startmenu shortcuts
119 createDirectory "$SMPROGRAMS\LibreCAD\"
120 createShortCut "$SMPROGRAMS\LibreCAD\LibreCAD.lnk" "$INSTDIR\LibreCAD.exe"
121 createShortCut "$SMPROGRAMS\LibreCAD\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
122
123 ; Open Donate URL
124 Exec "rundll32 url.dll,FileProtocolHandler http://librecad.org/donate.html"
125
126 SectionEnd
127
128 ;--------------------------------
129 ;Descriptions
130
131 ;Language strings
132 LangString DESC_SecInstall ${LANG_ENGLISH} "A test section."
133
134 ;--------------------------------
135 ;Uninstaller Section
136
137 Section "Uninstall"
138
139 ;ADD YOUR OWN FILES HERE...
140
141 Delete "$INSTDIR\Uninstall.exe"
142 RMDir /r "$SMPROGRAMS\LibreCAD\"
143 RMDir /r $INSTDIR
144
145 RMDir "$INSTDIR"
146
147 DeleteRegKey /ifempty HKCU "Software\LibreCAD"
148
149 SectionEnd
150
Something went wrong with that request. Please try again.