Page MenuHome

nsis_multiuser_fix.patch

Authored By
Caleb (dobz116)
Nov 13 2013, 2:57 PM
Size
8 KB
Subscribers
None

nsis_multiuser_fix.patch

Index: release/windows/installer/00.sconsblender.nsi
===================================================================
--- release/windows/installer/00.sconsblender.nsi (revision 36740)
+++ release/windows/installer/00.sconsblender.nsi (working copy)
@@ -2,7 +2,6 @@
; $Id$
;
; Blender Self-Installer for Windows (NSIS - http://nsis.sourceforge.net)
-;
SetCompressor /SOLID lzma
@@ -19,10 +18,10 @@
!define MUI_ABORTWARNING
-!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."
+!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."
!define MUI_WELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
!define MUI_HEADERIMAGE
-!define MUI_HEADERIMAGE_BITMAP "[RELDIR]\00.header.bmp"
+!define MUI_HEADERIMAGE_BITMAP "[RELDIR]\00.header.bmp"
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_FINISHPAGE_RUN "$INSTDIR\blender.exe"
!define MUI_CHECKBITMAP "[RELDIR]\00.checked.bmp"
@@ -31,12 +30,12 @@
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "[DISTDIR]\Copyright.txt"
!insertmacro MUI_PAGE_COMPONENTS
-
+
!insertmacro MUI_PAGE_DIRECTORY
Page custom DataLocation DataLocationOnLeave
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
-
+
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
@@ -45,15 +44,14 @@
!insertmacro Locate
!insertmacro VersionCompare
-
Icon "[RELDIR]\00.installer.ico"
UninstallIcon "[RELDIR]\00.installer.ico"
;--------------------------------
;Languages
-
+
!insertmacro MUI_LANGUAGE "English"
-
+
;--------------------------------
;Language Strings
@@ -82,9 +80,9 @@
; Custom controls
Var HWND
+Var HWND_SYSTEMAPPDATA
Var HWND_APPDATA
Var HWND_INSTDIR
-Var HWND_HOMEDIR
Function .onInit
ClearErrors
@@ -102,51 +100,49 @@
${EndIf}
FunctionEnd
-Function un.onInit
-FunctionEnd
-
Function DataLocation
nsDialogs::Create /NOUNLOAD 1018
Pop $HWND
-
+
${If} $HWND == error
Abort
${EndIf}
-
- ${NSD_CreateLabel} 0 0 100% 24u "Please specify where you wish to install Blender's user data files. Be aware that if you choose to use your Application Data directory, your preferences and scripts will only be accessible by the current user account."
- ${NSD_CreateRadioButton} 0 50 100% 12u "Use Application Data directory (recommended)"
+
+ ${NSD_CreateLabel} 0 0 100% 24u "Please specify where you wish to install Blender's user data files. Selecting the second option will result in Blender being usable by the current user only."
+ ${NSD_CreateRadioButton} 0 50 100% 12u "Use system appplication data directory. (recommended)"
+ Pop $HWND_SYSTEMAPPDATA
+ ${NSD_CreateRadioButton} 0 80 100% 12u "Use user appplication data directory. (not recommended)"
Pop $HWND_APPDATA
- ${NSD_CreateRadioButton} 0 80 100% 12u "Use installation directory"
+ ${NSD_CreateRadioButton} 0 110 100% 12u "Use installation directory."
Pop $HWND_INSTDIR
- ${NSD_CreateRadioButton} 0 110 100% 12u "I have defined a %HOME% variable, please install files there"
- Pop $HWND_HOMEDIR
-
+
${If} ${AtMostWinME}
+ GetDlgItem $0 $HWND $HWND_SYSTEMAPPDATA
+ EnableWindow $0 0
GetDlgItem $0 $HWND $HWND_APPDATA
EnableWindow $0 0
SendMessage $HWND_INSTDIR ${BM_SETCHECK} 1 0
${Else}
- SendMessage $HWND_APPDATA ${BM_SETCHECK} 1 0
+ SendMessage $HWND_SYSTEMAPPDATA ${BM_SETCHECK} 1 0
${EndIf}
-
+
nsDialogs::Show
-
FunctionEnd
Function DataLocationOnLeave
- ${NSD_GetState} $HWND_APPDATA $R0
+ ${NSD_GetState} $HWND_SYSTEMAPPDATA $R0
${If} $R0 == "1"
- SetShellVarContext current
- StrCpy $BLENDERHOME "$APPDATA\Blender Foundation\Blender"
SetShellVarContext all
+ StrCpy $BLENDERHOME "$APPDATA\Blender Foundation\Blender"
${Else}
- ${NSD_GetState} $HWND_INSTDIR $R0
+ ${NSD_GetState} $HWND_APPDATA $R0
${If} $R0 == "1"
- StrCpy $BLENDERHOME $INSTDIR
+ SetShellVarContext current
+ StrCpy $BLENDERHOME "$APPDATA\Blender Foundation\Blender"
${Else}
- ${NSD_GetState} $HWND_HOMEDIR $R0
+ ${NSD_GetState} $HWND_INSTDIR $R0
${If} $R0 == "1"
- ReadEnvStr $BLENDERHOME "HOME"
+ StrCpy $BLENDERHOME $INSTDIR
${EndIf}
${EndIf}
${EndIf}
@@ -159,25 +155,25 @@
SetOutPath $INSTDIR
; The contents of Blender installation root dir
[ROOTDIRCONTS]
-
+
; All datafiles (python, scripts, config)
[DODATAFILES]
-
+
SetOutPath $INSTDIR
${If} ${RunningX64}
SetRegView 64
${EndIf}
; Write the installation path into the registry
- WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "Install_Dir" "$INSTDIR"
- WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir" "$BLENDERHOME"
- WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ShortVersion" "[SHORTVERSION]"
+ WriteRegStr HKLM "SOFTWARE\Blender Foundation" "InstallDirectory" "$INSTDIR"
+ WriteRegStr HKLM "SOFTWARE\Blender Foundation" "DataDirectory" "$BLENDERHOME"
+ WriteRegStr HKLM "SOFTWARE\Blender Foundation" "ShortVersion" "[SHORTVERSION]"
; Write the uninstall keys for Windows
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "Publisher" "Blender Foundation"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "URLInfoAbout" "http://www.blender.org/"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayVersion" "[VERSION]"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayIcon" "$INSTDIR\blender.exe"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "Publisher" "Blender Foundation"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "URLInfoAbout" "http://www.blender.org/"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayVersion" "[VERSION]"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayIcon" "$INSTDIR\blender.exe"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "NoRepair " 1
WriteUninstaller "uninstall.exe"
@@ -211,11 +207,11 @@
${If} ${RunningX64}
SetRegView 64
${EndIf}
-
- ReadRegStr $BLENDERHOME HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir"
- ReadRegStr $SHORTVERSION HKLM "SOFTWARE\BlenderFoundation" "ShortVersion"
+
+ ReadRegStr $BLENDERHOME HKLM "SOFTWARE\Blender Foundation" "DataDirectory"
+ ReadRegStr $SHORTVERSION HKLM "SOFTWARE\Blender Foundation" "ShortVersion"
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Blender"
- DeleteRegKey HKLM "SOFTWARE\BlenderFoundation"
+ DeleteRegKey HKLM "SOFTWARE\Blender Foundation"
DeleteRegKey HKCR ".blend"
DeleteRegKey HKCR "blendfile"
DeleteRegKey HKCR "CLSID\{D45F043D-F17F-4e8a-8435-70971D9FA46D}"
@@ -248,7 +244,7 @@
RMDir /r "$SMPROGRAMS\Blender Foundation"
; Clear out installation dir
RMDir /r "$INSTDIR"
-
+
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; Refresh icons
SectionEnd
@@ -257,5 +253,4 @@
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} $(DESC_StartMenu)
!insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortcut} $(DESC_DesktopShortcut)
!insertmacro MUI_DESCRIPTION_TEXT ${BlendRegister} $(DESC_BlendRegister)
-!insertmacro MUI_FUNCTION_DESCRIPTION_END
-
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
\ No newline at end of file

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0e/37/9864bbf5aff001e9832dbc0e5f17

Event Timeline