~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to release/windows/installer/00.sconsblender.nsi

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;
2
 
; $Id: 00.sconsblender.nsi,v 1.9 2007/02/15 17:00:22 aphex Exp $
 
2
; $Id: 00.sconsblender.nsi,v 1.10 2007/05/06 16:43:50 aphex Exp $
3
3
;
4
4
; Blender Self-Installer for Windows (NSIS - http://nsis.sourceforge.net)
5
5
;
6
6
 
7
7
!include "MUI.nsh"
 
8
!include "FileFunc.nsh"
 
9
!include "WordFunc.nsh"
8
10
 
9
11
Name "Blender VERSION" 
10
12
 
32
34
!insertmacro MUI_UNPAGE_INSTFILES
33
35
!insertmacro MUI_UNPAGE_FINISH
34
36
 
 
37
!insertmacro Locate
 
38
!insertmacro VersionCompare
 
39
 
35
40
 
36
41
Icon "00.installer.ico"
37
42
UninstallIcon "00.installer.ico"
153
158
 
154
159
FunctionEnd
155
160
 
 
161
# Uses $0
 
162
Function openLinkNewWindow
 
163
  Push $3 
 
164
  Push $2
 
165
  Push $1
 
166
  Push $0
 
167
  ReadRegStr $0 HKCR "http\shell\open\command" ""
 
168
# Get browser path
 
169
    DetailPrint $0
 
170
  StrCpy $2 '"'
 
171
  StrCpy $1 $0 1
 
172
  StrCmp $1 $2 +2 # if path is not enclosed in " look for space as final char
 
173
    StrCpy $2 ' '
 
174
  StrCpy $3 1
 
175
  loop:
 
176
    StrCpy $1 $0 1 $3
 
177
    DetailPrint $1
 
178
    StrCmp $1 $2 found
 
179
    StrCmp $1 "" found
 
180
    IntOp $3 $3 + 1
 
181
    Goto loop
 
182
 
 
183
  found:
 
184
    StrCpy $1 $0 $3
 
185
    StrCmp $2 " " +2
 
186
      StrCpy $1 '$1"'
 
187
 
 
188
  Pop $0
 
189
  Exec '$1 $0'
 
190
  Pop $1
 
191
  Pop $2
 
192
  Pop $3
 
193
FunctionEnd
 
194
 
156
195
Var BLENDERHOME
157
196
Var winversion
 
197
Var DLL_found
158
198
 
159
199
Function SetWinXPPath
160
200
  StrCpy $BLENDERHOME "$PROFILE\Application Data\Blender Foundation\Blender"
171
211
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "data.ini"
172
212
FunctionEnd
173
213
 
 
214
!define DLL_VER "8.00.50727.42"
 
215
 
 
216
Function LocateCallback
 
217
 
 
218
        MoreInfo::GetProductVersion "$R9"
 
219
        Pop $0
 
220
 
 
221
        ${VersionCompare} "$0" "${DLL_VER}" $R1
 
222
 
 
223
        StrCmp $R1 0 0 new
 
224
      new:
 
225
        StrCmp $R1 1 0 old
 
226
      old:
 
227
        StrCmp $R1 2 0 end
 
228
        ; Found DLL is older
 
229
        Call DownloadDLL
 
230
 
 
231
     end:
 
232
        StrCpy "$0" StopLocate
 
233
        StrCpy $DLL_found "true"
 
234
        Push "$0"
 
235
 
 
236
FunctionEnd
 
237
 
 
238
Function DownloadDLL
 
239
    MessageBox MB_OK "You will need to download the Microsoft Visual C++ 2005 Redistributable Package in order to run Blender. Pressing OK will take you to the download page, please follow the instructions on the page that appears."
 
240
    StrCpy $0 "http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en"
 
241
    Call openLinkNewWindow
 
242
FunctionEnd
 
243
 
 
244
 
174
245
Var HWND
175
246
Var DLGITEM
176
247
Var is2KXP
267
338
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender (remove only)"
268
339
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
269
340
  WriteUninstaller "uninstall.exe"
 
341
 
 
342
  ; Check for msvcr80.dll - give notice to download if not found
 
343
  MessageBox MB_OK "The installer will now check your system for the required system dlls."
 
344
  StrCpy $1 $WINDIR
 
345
  StrCpy $DLL_found "false"
 
346
  ${Locate} "$1" "/L=F /M=MSVCR80.DLL /S=0B" "LocateCallback"
 
347
  StrCmp $DLL_found "false" 0 +2
 
348
    Call DownloadDLL
 
349
  
270
350
SectionEnd
271
351
 
272
352
Section "Add Start Menu shortcuts" Section2