1 /* Resources.Designer.cs $
\r
3 This file is part of the HandBrake source code.
\r
4 Homepage: <http://handbrake.fr/>.
\r
5 It may be used under the terms of the GNU General Public License. */
\r
7 ; Script generated by the HM NIS Edit Script Wizard.
\r
9 ; HM NIS Edit Wizard helper defines
\r
10 !define PRODUCT_NAME "Handbrake"
\r
11 !define PRODUCT_VERSION "SVN 3191 Snapshot"
\r
12 !define PRODUCT_VERSION_NUMBER "svn3191"
\r
13 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Handbrake.exe"
\r
14 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
\r
15 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
\r
17 ;Required .NET framework
\r
18 !define MIN_FRA_MAJOR "3"
\r
19 !define MIN_FRA_MINOR "5"
\r
20 !define MIN_FRA_BUILD "*"
\r
24 ; MUI 1.67 compatible ------
\r
28 !define MUI_ABORTWARNING
\r
29 !define MUI_ICON "handbrakepineapple.ico"
\r
30 !define MUI_UNICON "handbrakepineapple.ico"
\r
33 !insertmacro MUI_PAGE_WELCOME
\r
35 !insertmacro MUI_PAGE_LICENSE "doc\COPYING"
\r
37 !insertmacro MUI_PAGE_DIRECTORY
\r
39 !insertmacro MUI_PAGE_INSTFILES
\r
41 !define MUI_FINISHPAGE_RUN "$INSTDIR\Handbrake.exe"
\r
42 !insertmacro MUI_PAGE_FINISH
\r
45 !insertmacro MUI_UNPAGE_INSTFILES
\r
48 !insertmacro MUI_LANGUAGE "English"
\r
52 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
\r
53 OutFile "HandBrake-${PRODUCT_VERSION_NUMBER}-Win_GUI.exe"
\r
55 !include WordFunc.nsh
\r
56 !insertmacro VersionCompare
\r
57 !include LogicLib.nsh
\r
59 InstallDir "$PROGRAMFILES\Handbrake"
\r
60 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
\r
61 ShowInstDetails show
\r
62 ShowUnInstDetails show
\r
68 ; Begin Only allow one version
\r
69 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
\r
73 MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
\r
76 ;Remove previous version
\r
77 ReadRegStr $R0 HKLM \
\r
78 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}\" \
\r
82 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
\r
83 "${PRODUCT_NAME} ${PRODUCT_VERSION} is already installed. $\n$\nClick `OK` to remove the \
\r
84 previous version or `Cancel` to continue." \
\r
88 ;Run the uninstaller
\r
90 Exec $INSTDIR\uninst.exe
\r
95 Section "Handbrake" SEC01
\r
96 SetOutPath "$INSTDIR"
\r
97 SetOverwrite ifnewer
\r
99 ; Begin Check .NET version
\r
100 StrCpy $InstallDotNET "No"
\r
101 Call CheckFramework
\r
103 StrCpy $InstallDotNET "Yes"
\r
104 MessageBox MB_OK|MB_ICONINFORMATION "${PRODUCT_NAME} requires that the .NET Framework 3.5 SP1 is installed. The latest .NET Framework will be downloaded and installed automatically during installation of ${PRODUCT_NAME}."
\r
107 ; Get .NET if required
\r
108 ${If} $InstallDotNET == "Yes"
\r
109 SetDetailsView hide
\r
110 inetc::get /caption "Downloading .NET Framework 3.5" /canceltext "Cancel" "http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=ab99342f-5d1a-413d-8319-81da479ab0d7&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f0%2f6%2f1%2f061f001c-8752-4600-a198-53214c69b51f%2fdotnetfx35setup.exe" "$INSTDIR\dotnetfx.exe" /end
\r
114 Delete "$INSTDIR\dotnetfx.exe"
\r
115 Abort "Installation cancelled, ${PRODUCT_NAME} requires the .NET 3.5 Framework"
\r
118 ExecWait "$INSTDIR\dotnetfx.exe"
\r
119 Delete "$INSTDIR\dotnetfx.exe"
\r
121 SetDetailsView show
\r
125 File "Handbrake.exe"
\r
126 CreateDirectory "$SMPROGRAMS\Handbrake"
\r
127 CreateShortCut "$SMPROGRAMS\Handbrake\Handbrake.lnk" "$INSTDIR\Handbrake.exe"
\r
128 CreateShortCut "$DESKTOP\Handbrake.lnk" "$INSTDIR\Handbrake.exe"
\r
129 File "Interop.QTOLibrary.dll"
\r
130 File "Interop.QTOControlLib.dll"
\r
131 File "AxInterop.QTOControlLib.dll"
\r
132 File "Growl.Connector.dll"
\r
133 File "Growl.CoreLibrary.dll"
\r
134 File "libgcc_s_sjlj-1.dll"
\r
135 File "HandBrakeCLI.exe"
\r
136 File "Handbrake.exe.config"
\r
137 File "handbrakepineapple.ico"
\r
139 SetOutPath "$INSTDIR\doc"
\r
140 SetOverwrite ifnewer
\r
146 File "doc\TRANSLATIONS"
\r
149 Section -AdditionalIcons
\r
150 CreateShortCut "$SMPROGRAMS\Handbrake\Uninstall.lnk" "$INSTDIR\uninst.exe"
\r
154 WriteUninstaller "$INSTDIR\uninst.exe"
\r
155 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\Handbrake.exe"
\r
156 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
\r
157 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
\r
158 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Handbrake.exe"
\r
159 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
\r
162 Function un.onUninstSuccess
\r
164 MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
\r
168 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
\r
173 Delete "$INSTDIR\uninst.exe"
\r
175 Delete "$INSTDIR\Interop.QTOLibrary.dll"
\r
176 Delete "$INSTDIR\Interop.QTOControlLib.dll"
\r
177 Delete "$INSTDIR\AxInterop.QTOControlLib.dll"
\r
178 Delete "$INSTDIR\HandBrakeCLI.exe"
\r
179 Delete "$INSTDIR\handbrakepineapple.ico"
\r
180 Delete "$INSTDIR\Handbrake.exe"
\r
181 Delete "$INSTDIR\Handbrake.exe.config"
\r
182 Delete "$INSTDIR\Growl.Connector.dll"
\r
183 Delete "$INSTDIR\Growl.CoreLibrary.dll"
\r
184 Delete "$INSTDIR\libgcc_s_sjlj-1.dll"
\r
185 Delete "$INSTDIR\doc\AUTHORS"
\r
186 Delete "$INSTDIR\doc\COPYING"
\r
187 Delete "$INSTDIR\doc\CREDITS"
\r
188 Delete "$INSTDIR\doc\NEWS"
\r
189 Delete "$INSTDIR\doc\THANKS"
\r
190 Delete "$INSTDIR\doc\TRANSLATIONS"
\r
192 Delete "$SMPROGRAMS\Handbrake\Uninstall.lnk"
\r
193 Delete "$DESKTOP\Handbrake.lnk"
\r
194 Delete "$SMPROGRAMS\Handbrake\Handbrake.lnk"
\r
195 RMDir "$SMPROGRAMS\Handbrake"
\r
198 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
\r
199 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
\r
203 ;Check for .NET framework
\r
204 Function CheckFrameWork
\r
206 ;Save the variables in case something else is using them
\r
229 ;Get each sub key under "SOFTWARE\Microsoft\NET Framework Setup\NDP"
\r
230 EnumRegKey $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP" $0
\r
231 StrCmp $1 "" done ;jump to end if no more registry keys
\r
233 StrCpy $2 $1 1 ;Cut off the first character
\r
234 StrCpy $3 $1 "" 1 ;Remainder of string
\r
236 ;Loop if first character is not a 'v'
\r
237 StrCmpS $2 "v" start_parse loop
\r
249 StrCmp $3 "" parse_done ;If string is empty, we are finished
\r
250 StrCpy $2 $3 1 ;Cut off the first character
\r
251 StrCpy $3 $3 "" 1 ;Remainder of string
\r
252 StrCmp $2 "." is_dot not_dot ;Move to next part if it's a dot
\r
255 IntOp $4 $4 + 1 ; Move to the next section
\r
256 goto parse ;Carry on parsing
\r
259 IntCmp $4 1 major_ver
\r
260 IntCmp $4 2 minor_ver
\r
261 IntCmp $4 3 build_ver
\r
262 IntCmp $4 4 parse_done
\r
266 goto parse ;Carry on parsing
\r
270 goto parse ;Carry on parsing
\r
274 goto parse ;Carry on parsing
\r
278 IntCmp $R1 $R5 this_major_same loop this_major_more
\r
288 IntCmp $R2 $R6 this_minor_same loop this_minor_more
\r
296 IntCmp $R3 $R7 loop loop this_build_more
\r
304 ;Have we got the framework we need?
\r
305 IntCmp $R5 ${MIN_FRA_MAJOR} max_major_same fail OK
\r
307 IntCmp $R6 ${MIN_FRA_MINOR} max_minor_same fail OK
\r
309 IntCmp $R7 ${MIN_FRA_BUILD} OK fail OK
\r
311 ;Version on machine is greater than what we need
\r
317 StrCmp $R8 "0.0.0" end
\r
322 ;Pop the variables we pushed earlier
\r