~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
;
2
 
; $Id$
3
 
;
4
 
; Blender Self-Installer for Windows (NSIS - http://nsis.sourceforge.net)
5
 
;
6
 
; Requires the MoreInfo plugin - http://nsis.sourceforge.net/MoreInfo_plug-in
7
 
;
8
 
 
9
 
!include "MUI.nsh"
10
 
!include "WinVer.nsh"
11
 
!include "FileFunc.nsh"
12
 
!include "WordFunc.nsh"
13
 
!include "nsDialogs.nsh"
14
 
 
15
 
SetCompressor /SOLID lzma
16
 
 
17
 
Name "Blender [VERSION]" 
18
 
 
19
 
!define MUI_ABORTWARNING
20
 
 
21
 
!define MUI_WELCOMEPAGE_TEXT  "This wizard will guide you through the installation of Blender. It is recommended that you close all other applications before starting Setup."
22
 
!define MUI_WELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
23
 
!define MUI_HEADERIMAGE
24
 
!define MUI_HEADERIMAGE_BITMAP  "[RELDIR]\00.header.bmp"
25
 
!define MUI_COMPONENTSPAGE_SMALLDESC
26
 
!define MUI_FINISHPAGE_RUN "$INSTDIR\blender.exe"
27
 
!define MUI_CHECKBITMAP "[RELDIR]\00.checked.bmp"
28
 
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
29
 
 
30
 
!insertmacro MUI_PAGE_WELCOME
31
 
!insertmacro MUI_PAGE_LICENSE "[DISTDIR]\Copyright.txt"
32
 
!insertmacro MUI_PAGE_COMPONENTS
33
 
    
34
 
!insertmacro MUI_PAGE_DIRECTORY
35
 
Page custom DataLocation DataLocationOnLeave
36
 
!insertmacro MUI_PAGE_INSTFILES
37
 
!insertmacro MUI_PAGE_FINISH
38
 
  
39
 
!insertmacro MUI_UNPAGE_WELCOME
40
 
!insertmacro MUI_UNPAGE_CONFIRM
41
 
!insertmacro MUI_UNPAGE_INSTFILES
42
 
!insertmacro MUI_UNPAGE_FINISH
43
 
 
44
 
!insertmacro Locate
45
 
!insertmacro VersionCompare
46
 
 
47
 
 
48
 
Icon "[RELDIR]\00.installer.ico"
49
 
UninstallIcon "[RELDIR]\00.installer.ico"
50
 
 
51
 
;--------------------------------
52
 
;Languages
53
 
 
54
 
  !insertmacro MUI_LANGUAGE "English"
55
 
    
56
 
;--------------------------------
57
 
;Language Strings
58
 
 
59
 
  ;Description
60
 
  LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy all required files to the application folder."
61
 
  LangString DESC_Section2 ${LANG_ENGLISH} "Add shortcut items to the Start Menu. (Recommended)"
62
 
  LangString DESC_Section3 ${LANG_ENGLISH} "Add a shortcut to Blender on your desktop."
63
 
  LangString DESC_Section4 ${LANG_ENGLISH} "Blender can register itself with .blend files to allow double-clicking from Windows Explorer, etc."
64
 
  LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Specify User Data Location"
65
 
;--------------------------------
66
 
;Data
67
 
 
68
 
Caption "Blender [VERSION] Installer"
69
 
OutFile "[DISTDIR]\..\blender-[VERSION]-windows[BITNESS].exe"
70
 
InstallDir "$PROGRAMFILES[BITNESS]\Blender Foundation\Blender"
71
 
 
72
 
BrandingText "Blender Foundation | http://www.blender.org"
73
 
ComponentText "This will install Blender [VERSION] on your computer."
74
 
 
75
 
DirText "Use the field below to specify the folder where you want Blender to be copied to. To specify a different folder, type a new name or use the Browse button to select an existing folder."
76
 
 
77
 
SilentUnInstall normal
78
 
 
79
 
Var BLENDERHOME
80
 
Var SHORTVERSION ; This is blender_version_decimal() from path_util.c
81
 
 
82
 
; custom controls
83
 
Var HWND
84
 
 
85
 
Var HWND_APPDATA
86
 
Var HWND_INSTDIR
87
 
Var HWND_HOMEDIR
88
 
 
89
 
Function .onInit
90
 
  ClearErrors
91
 
  StrCpy $SHORTVERSION "[SHORTVERSION]"
92
 
FunctionEnd
93
 
 
94
 
Function DataLocation
95
 
  nsDialogs::Create /NOUNLOAD 1018
96
 
  Pop $HWND
97
 
  
98
 
  ${If} $HWND == error
99
 
    Abort
100
 
  ${EndIf}
101
 
  
102
 
  ${NSD_CreateLabel} 0 0 100% 12u "Please specify where you wish to install Blender's user data files."
103
 
  ${NSD_CreateRadioButton} 0 20 100% 12u "Use the Application Data directory (Requires Windows 2000 or better)"
104
 
  Pop $HWND_APPDATA
105
 
  ${NSD_CreateRadioButton} 0 50 100% 12u "Use the installation directory (ie. location chosen to install blender.exe)."
106
 
  Pop $HWND_INSTDIR
107
 
  ${NSD_CreateRadioButton} 0 80 100% 12u "I have defined a %HOME% variable, please install files here."
108
 
  Pop $HWND_HOMEDIR
109
 
  
110
 
  ${If} ${AtMostWinME}
111
 
    GetDlgItem $0 $HWND $HWND_APPDATA
112
 
    EnableWindow $0 0
113
 
    SendMessage $HWND_INSTDIR ${BM_SETCHECK} 1 0
114
 
  ${Else}
115
 
    SendMessage $HWND_APPDATA ${BM_SETCHECK} 1 0
116
 
  ${EndIf}
117
 
  
118
 
  nsDialogs::Show
119
 
  
120
 
FunctionEnd
121
 
 
122
 
Function DataLocationOnLeave
123
 
  ${NSD_GetState} $HWND_APPDATA $R0
124
 
  ${If} $R0 == "1"
125
 
    StrCpy $BLENDERHOME "$APPDATA\Blender Foundation\Blender"
126
 
  ${Else}
127
 
    ${NSD_GetState} $HWND_INSTDIR $R0
128
 
    ${If} $R0 == "1"
129
 
      StrCpy $BLENDERHOME $INSTDIR
130
 
    ${Else}
131
 
      ${NSD_GetState} $HWND_HOMEDIR $R0
132
 
      ${If} $R0 == "1"
133
 
        ReadEnvStr $BLENDERHOME "HOME"
134
 
      ${EndIf}
135
 
    ${EndIf}
136
 
  ${EndIf}
137
 
FunctionEnd
138
 
 
139
 
Section "Blender-[VERSION] (required)" SecCopyUI
140
 
  SectionIn RO
141
 
 
142
 
  ; Set output path to the installation directory.
143
 
  SetOutPath $INSTDIR
144
 
  ; the contents of Blender installation root dir
145
 
  [ROOTDIRCONTS]
146
 
  
147
 
  ; all datafiles (python, scripts, config)
148
 
  [DODATAFILES]
149
 
  
150
 
  SetOutPath $INSTDIR
151
 
  ; Write the installation path into the registry
152
 
  WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "Install_Dir" "$INSTDIR"
153
 
  WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir" "$BLENDERHOME"
154
 
  WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ShortVersion" "[SHORTVERSION]"
155
 
  ; Write the uninstall keys for Windows
156
 
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender (remove only)"
157
 
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
158
 
  WriteUninstaller "uninstall.exe"
159
 
 
160
 
  ; Let's now run silent vcredist installer
161
 
  SetOutPath $TEMP
162
 
  [VCREDIST]
163
 
 
164
 
SectionEnd
165
 
 
166
 
Section "Add Start Menu shortcuts" Section2
167
 
  SetShellVarContext all
168
 
  CreateDirectory "$SMPROGRAMS\Blender Foundation\Blender\"
169
 
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
170
 
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Blender.lnk" "$INSTDIR\Blender.exe" "" "$INSTDIR\blender.exe" 0
171
 
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Readme.lnk" "$INSTDIR\readme.html" "" "" 0
172
 
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Copyright.lnk" "$INSTDIR\Copyright.txt" "" "$INSTDIR\copyright.txt" 0
173
 
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\GPL-license.lnk" "$INSTDIR\GPL-license.txt" "" "$INSTDIR\GPL-license.txt" 0
174
 
SectionEnd
175
 
 
176
 
Section "Add Desktop Blender-[VERSION] shortcut" Section3
177
 
  CreateShortCut "$DESKTOP\Blender.lnk" "$INSTDIR\blender.exe" "" "$INSTDIR\blender.exe" 0
178
 
SectionEnd
179
 
 
180
 
Section "Open .blend files with Blender-[VERSION]" Section4
181
 
  
182
 
  WriteRegStr HKCR ".blend" "" "blendfile"
183
 
  WriteRegStr HKCR "blendfile" "" "Blender .blend File"
184
 
  WriteRegStr HKCR "blendfile\shell" "" "open"
185
 
  WriteRegStr HKCR "blendfile\DefaultIcon" "" $INSTDIR\blender.exe,1
186
 
  WriteRegStr HKCR "blendfile\shell\open\command" "" \
187
 
    '"$INSTDIR\blender.exe" "%1"'
188
 
  
189
 
SectionEnd
190
 
 
191
 
UninstallText "This will uninstall Blender [VERSION], and all datafiles from the installation dir. Hit next to continue."
192
 
 
193
 
Section "Uninstall"
194
 
  ; remove registry keys
195
 
  ReadRegStr $BLENDERHOME HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir"
196
 
  ReadRegStr $SHORTVERSION HKLM "SOFTWARE\BlenderFoundation" "ShortVersion"
197
 
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender"
198
 
  DeleteRegKey HKLM "SOFTWARE\BlenderFoundation"
199
 
  SetShellVarContext all
200
 
 
201
 
  StrCpy $0 "$SMPROGRAMS\Blender Foundation\"
202
 
  MessageBox MB_OK $0
203
 
  ; remove files
204
 
  [DELROOTDIRCONTS]
205
 
 
206
 
  Delete "$INSTDIR\uninstall.exe"
207
 
 
208
 
  MessageBox MB_YESNO "Erase $BLENDERHOME? This includes all installed scripts and configuration files and any file you may have created there." IDNO Next
209
 
  RMDir /r "$BLENDERHOME"
210
 
Next:
211
 
  ; remove shortcuts, if any.
212
 
  Delete "$DESKTOP\Blender.lnk"
213
 
  ; remove all link related directories and files
214
 
  RMDir /r "$SMPROGRAMS\Blender Foundation\"
215
 
  ; remove entire installation directory, including any file created by the user
216
 
  RMDir /r "$INSTDIR"
217
 
SectionEnd
218
 
 
219
 
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
220
 
  !insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
221
 
  !insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
222
 
  !insertmacro MUI_DESCRIPTION_TEXT ${Section3} $(DESC_Section3)
223
 
  !insertmacro MUI_DESCRIPTION_TEXT ${Section4} $(DESC_Section4)
224
 
!insertmacro MUI_FUNCTION_DESCRIPTION_END
225
 
 
 
1
;
 
2
;
 
3
; Blender Self-Installer for Windows (NSIS - http://nsis.sourceforge.net)
 
4
;
 
5
 
 
6
SetCompressor /SOLID lzma
 
7
 
 
8
Name "Blender [VERSION]" 
 
9
 
 
10
RequestExecutionLevel admin
 
11
 
 
12
!include "MUI.nsh"
 
13
!include "WinVer.nsh"
 
14
!include "FileFunc.nsh"
 
15
!include "WordFunc.nsh"
 
16
!include "nsDialogs.nsh"
 
17
!include "x64.nsh"
 
18
 
 
19
!define MUI_ABORTWARNING
 
20
 
 
21
!define MUI_WELCOMEPAGE_TEXT  "This wizard will guide you through the installation of Blender. It is recommended that you close all other applications before starting Setup."
 
22
!define MUI_WELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
 
23
!define MUI_HEADERIMAGE
 
24
!define MUI_HEADERIMAGE_BITMAP  "[RELDIR]\00.header.bmp"
 
25
!define MUI_COMPONENTSPAGE_SMALLDESC
 
26
!define MUI_FINISHPAGE_RUN "$INSTDIR\blender.exe"
 
27
!define MUI_CHECKBITMAP "[RELDIR]\00.checked.bmp"
 
28
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
 
29
 
 
30
!insertmacro MUI_PAGE_WELCOME
 
31
!insertmacro MUI_PAGE_LICENSE "[DISTDIR]\Copyright.txt"
 
32
!insertmacro MUI_PAGE_COMPONENTS
 
33
    
 
34
!insertmacro MUI_PAGE_DIRECTORY
 
35
!insertmacro MUI_PAGE_INSTFILES
 
36
!insertmacro MUI_PAGE_FINISH
 
37
  
 
38
!insertmacro MUI_UNPAGE_WELCOME
 
39
UninstPage custom un.OptionalRemoveConfig un.OptionalRemoveConfigOnLeave
 
40
!insertmacro MUI_UNPAGE_CONFIRM
 
41
!insertmacro MUI_UNPAGE_INSTFILES
 
42
!insertmacro MUI_UNPAGE_FINISH
 
43
 
 
44
!insertmacro Locate
 
45
!insertmacro VersionCompare
 
46
 
 
47
 
 
48
Icon "[RELDIR]\00.installer.ico"
 
49
UninstallIcon "[RELDIR]\00.installer.ico"
 
50
 
 
51
;--------------------------------
 
52
;Languages
 
53
 
 
54
  !insertmacro MUI_LANGUAGE "English"
 
55
    
 
56
;--------------------------------
 
57
;Language Strings
 
58
 
 
59
  ;Description
 
60
  LangString DESC_InstallFiles ${LANG_ENGLISH} "Copy all required files to the application folder."
 
61
  LangString DESC_StartMenu ${LANG_ENGLISH} "Add shortcut items to the Start Menu. (Recommended)"
 
62
  LangString DESC_DesktopShortcut ${LANG_ENGLISH} "Add a shortcut to Blender on your desktop."
 
63
  LangString DESC_BlendRegister ${LANG_ENGLISH} "Blender can register itself with .blend files to allow double-clicking from Windows Explorer, etc."
 
64
;--------------------------------
 
65
;Data
 
66
 
 
67
Caption "Blender [VERSION] Installer"
 
68
OutFile "[DISTDIR]\..\blender-[VERSION]-windows[BITNESS].exe"
 
69
InstallDir $INSTDIR ; $INSTDIR is set inside .onInit
 
70
BrandingText "Blender Foundation | http://www.blender.org"
 
71
ComponentText "This will install Blender [VERSION] on your computer."
 
72
 
 
73
DirText "Use the field below to specify the folder where you want Blender to be copied to. To specify a different folder, type a new name or use the Browse button to select an existing folder."
 
74
 
 
75
SilentUnInstall normal
 
76
 
 
77
Var SHORTVERSION ; This is blender_version_decimal() from path_util.c
 
78
Var BLENDERCONFIG
 
79
Var REMOVECONFIG
 
80
 
 
81
; Custom controls
 
82
Var HWND
 
83
 
 
84
Var HWND_KEEPCONFIG
 
85
Var HWND_REMOVECONFIG
 
86
 
 
87
Function .onInit
 
88
  ClearErrors
 
89
  StrCpy $SHORTVERSION "[SHORTVERSION]"
 
90
 
 
91
  ${If} ${RunningX64}
 
92
    ${If} "[BITNESS]" == "32"
 
93
      StrCpy $INSTDIR "$PROGRAMFILES32\Blender Foundation\Blender" ; Can't use InstallDir inside Section
 
94
    ${ElseIf} "[BITNESS]" == "64"
 
95
      StrCpy $INSTDIR "$PROGRAMFILES64\Blender Foundation\Blender"
 
96
    ${EndIf}
 
97
  ${Else}
 
98
    StrCpy $INSTDIR "$PROGRAMFILES\Blender Foundation\Blender"
 
99
  ${EndIf}
 
100
FunctionEnd
 
101
 
 
102
Function un.onInit
 
103
  SetShellVarContext current
 
104
  StrCpy $BLENDERCONFIG "$APPDATA\Blender Foundation\Blender"
 
105
  SetShellVarContext all
 
106
FunctionEnd
 
107
 
 
108
Function un.OptionalRemoveConfig
 
109
  nsDialogs::Create /NOUNLOAD 1018
 
110
  Pop $HWND
 
111
  
 
112
  ${If} $HWND == error
 
113
    Abort
 
114
  ${EndIf}
 
115
  
 
116
  ${NSD_CreateRadioButton} 0 50 100% 12u "Keep configuration files, autosaved .blend files and installed addons (recommended)"
 
117
  Pop $HWND_KEEPCONFIG
 
118
  ${NSD_CreateRadioButton} 0 80 100% 12u "Remove all files, including configuration files, autosaved .blend files and installed addons"
 
119
  Pop $HWND_REMOVECONFIG
 
120
 
 
121
  SendMessage $HWND_KEEPCONFIG ${BM_SETCHECK} 1 0
 
122
  
 
123
  nsDialogs::Show
 
124
  
 
125
FunctionEnd
 
126
 
 
127
Function un.OptionalRemoveConfigOnLeave
 
128
  ${NSD_GetState} $HWND_REMOVECONFIG $R0
 
129
  ${If} $R0 == "1"
 
130
    StrCpy $REMOVECONFIG "1"
 
131
  ${Else}
 
132
    StrCpy $REMOVECONFIG "0"
 
133
  ${EndIf}
 
134
FunctionEnd
 
135
 
 
136
 
 
137
Section "Blender [VERSION] (required)" InstallFiles
 
138
  SectionIn RO
 
139
 
 
140
  ; Set output path to the installation directory.
 
141
  SetOutPath $INSTDIR
 
142
  ; The contents of Blender installation root dir
 
143
  [ROOTDIRCONTS]
 
144
  
 
145
  ; All datafiles (python, scripts, datafiles)
 
146
  [DODATAFILES]
 
147
  
 
148
  SetOutPath $INSTDIR
 
149
  ${If} ${RunningX64}
 
150
    SetRegView 64
 
151
  ${EndIf}
 
152
  ; Write the installation path into the registry
 
153
  WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "Install_Dir" "$INSTDIR"
 
154
  WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ShortVersion" "[SHORTVERSION]"
 
155
  ; Write the uninstall keys for Windows
 
156
  WriteRegStr   HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender"
 
157
  WriteRegStr   HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "Publisher" "Blender Foundation"
 
158
  WriteRegStr   HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "URLInfoAbout" "http://www.blender.org/"
 
159
  WriteRegStr   HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayVersion" "[VERSION]"
 
160
  WriteRegStr   HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayIcon" "$INSTDIR\blender.exe"
 
161
  WriteRegStr   HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
 
162
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "NoModify" 1
 
163
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "NoRepair " 1
 
164
  WriteUninstaller "uninstall.exe"
 
165
 
 
166
SectionEnd
 
167
 
 
168
Section "Add Start Menu Shortcuts" StartMenu
 
169
  SetShellVarContext all
 
170
  CreateDirectory "$SMPROGRAMS\Blender Foundation\Blender\"
 
171
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
 
172
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Blender.lnk" "$INSTDIR\Blender.exe" "" "$INSTDIR\blender.exe" 0
 
173
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Readme.lnk" "$INSTDIR\readme.html" "" "" 0
 
174
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Copyright.lnk" "$INSTDIR\Copyright.txt" "" "$INSTDIR\copyright.txt" 0
 
175
  CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\GPL-license.lnk" "$INSTDIR\GPL-license.txt" "" "$INSTDIR\GPL-license.txt" 0
 
176
  System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; refresh icons
 
177
SectionEnd
 
178
 
 
179
Section "Add Desktop Shortcut" DesktopShortcut
 
180
  CreateShortCut "$DESKTOP\Blender.lnk" "$INSTDIR\blender.exe" "" "$INSTDIR\blender.exe" 0
 
181
  System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; refresh icons
 
182
SectionEnd
 
183
 
 
184
Section "Open .blend files with Blender" BlendRegister
 
185
  ExecWait '"$INSTDIR\blender.exe" -r'
 
186
SectionEnd
 
187
 
 
188
UninstallText "This will uninstall Blender [VERSION], and all installed files. Hit 'Uninstall' to continue."
 
189
 
 
190
Section "Uninstall"
 
191
  ; Remove registry keys
 
192
  ${If} ${RunningX64}
 
193
    SetRegView 64
 
194
  ${EndIf}
 
195
  
 
196
  ReadRegStr $SHORTVERSION HKLM "SOFTWARE\BlenderFoundation" "ShortVersion"
 
197
  DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Blender"
 
198
  DeleteRegKey HKLM "SOFTWARE\BlenderFoundation"
 
199
  DeleteRegKey HKCR ".blend"
 
200
  DeleteRegKey HKCR "blendfile"
 
201
  DeleteRegKey HKCR "CLSID\{D45F043D-F17F-4e8a-8435-70971D9FA46D}"
 
202
  SetShellVarContext all
 
203
 
 
204
  ; Remove files
 
205
  [DELROOTDIRCONTS]
 
206
  [DELDATAFILES]
 
207
  [DELDATADIRS]
 
208
 
 
209
  Delete "$INSTDIR\uninstall.exe"
 
210
 
 
211
  ${If} $REMOVECONFIG == "1"
 
212
    RMDir /r "$BLENDERCONFIG\$SHORTVERSION"
 
213
  ${Endif}
 
214
 
 
215
  ; Remove install directory if it's empty
 
216
  RMDir $INSTDIR
 
217
  ; Remove shortcuts
 
218
  Delete "$SMPROGRAMS\Blender Foundation\Blender\*.*"
 
219
  Delete "$DESKTOP\Blender.lnk"
 
220
  ; Remove all link related directories and files
 
221
  RMDir "$SMPROGRAMS\Blender Foundation\Blender"
 
222
  RMDir "$SMPROGRAMS\Blender Foundation"
 
223
  
 
224
  System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; Refresh icons
 
225
SectionEnd
 
226
 
 
227
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
 
228
  !insertmacro MUI_DESCRIPTION_TEXT ${InstallFiles} $(DESC_InstallFiles)
 
229
  !insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} $(DESC_StartMenu)
 
230
  !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortcut} $(DESC_DesktopShortcut)
 
231
  !insertmacro MUI_DESCRIPTION_TEXT ${BlendRegister} $(DESC_BlendRegister)
 
232
!insertmacro MUI_FUNCTION_DESCRIPTION_END
 
233