diff --git a/admin/win/msi/CMakeLists.txt b/admin/win/msi/CMakeLists.txt index 933037dac115..90f7af9d0c85 100644 --- a/admin/win/msi/CMakeLists.txt +++ b/admin/win/msi/CMakeLists.txt @@ -29,6 +29,8 @@ install(FILES Nextcloud.wxs ${CMAKE_CURRENT_BINARY_DIR}/RegistryCleanup.vbs RegistryCleanupCustomAction.wxs + UinstallOldClientDlg.wxs + License.rtf gui/banner.bmp gui/dialog.bmp DESTINATION msi/) diff --git a/admin/win/msi/License.rtf b/admin/win/msi/License.rtf new file mode 100644 index 000000000000..c5550a6c51b0 Binary files /dev/null and b/admin/win/msi/License.rtf differ diff --git a/admin/win/msi/Nextcloud.wxs b/admin/win/msi/Nextcloud.wxs index 4719d85dc0ac..98dc0e29db73 100644 --- a/admin/win/msi/Nextcloud.wxs +++ b/admin/win/msi/Nextcloud.wxs @@ -45,7 +45,6 @@ https://www.joyofsetup.com/2010/01/16/major-upgrades-now-easier-than-ever/ --> - @@ -54,6 +53,8 @@ + C:\Windows\System32\ + @@ -65,6 +66,11 @@ + + @@ -80,6 +86,59 @@ + + + + + @@ -128,18 +187,27 @@ --> - - - 1 - - 1 + 1 + 1 + 1 + + + + + + + Not Installed + 1 - + NOT (LAUNCH=0) + - + + diff --git a/admin/win/msi/OEM.wxi.in b/admin/win/msi/OEM.wxi.in index ae8f964e28f5..dbc847a5c762 100644 --- a/admin/win/msi/OEM.wxi.in +++ b/admin/win/msi/OEM.wxi.in @@ -22,6 +22,7 @@ + @@ -36,9 +37,8 @@ + and uncomment + diff --git a/admin/win/msi/RegistryCleanup.vbs b/admin/win/msi/RegistryCleanup.vbs new file mode 100644 index 000000000000..50e26c8ca7ed --- /dev/null +++ b/admin/win/msi/RegistryCleanup.vbs @@ -0,0 +1,54 @@ +On Error goto 0 + +Const HKEY_LOCAL_MACHINE = &H80000002 + +Const strObjRegistry = "winmgmts:\\.\root\default:StdRegProv" + +Function RegistryDeleteKeyRecursive(regRoot, strKeyPath) + Set objRegistry = GetObject(strObjRegistry) + objRegistry.EnumKey regRoot, strKeyPath, arrSubkeys + If IsArray(arrSubkeys) Then + For Each strSubkey In arrSubkeys + RegistryDeleteKeyRecursive regRoot, strKeyPath & "\" & strSubkey + Next + End If + objRegistry.DeleteKey regRoot, strKeyPath +End Function + +Function RegistryListSubkeys(regRoot, strKeyPath) + Set objRegistry = GetObject(strObjRegistry) + objRegistry.EnumKey regRoot, strKeyPath, arrSubkeys + RegistryListSubkeys = arrSubkeys +End Function + +Function GetUserSID() + Dim objWshNetwork, objUserAccount + + Set objWshNetwork = CreateObject("WScript.Network") + + Set objUserAccount = GetObject("winmgmts://" & objWshNetwork.UserDomain & "/root/cimv2").Get("Win32_UserAccount.Domain='" & objWshNetwork.ComputerName & "',Name='" & objWshNetwork.UserName & "'") + GetUserSID = objUserAccount.SID +End Function + +Function RegistryCleanupSyncRootManager() + strSyncRootManagerKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager" + + arrSubKeys = RegistryListSubkeys(HKEY_LOCAL_MACHINE, strSyncRootManagerKeyPath) + + If IsArray(arrSubkeys) Then + arrSubkeys=Filter(arrSubkeys, Session.Property("APPNAME")) + End If + If IsArray(arrSubkeys) Then + arrSubkeys=Filter(arrSubkeys, GetUserSID()) + End If + + If IsArray(arrSubkeys) Then + For Each strSubkey In arrSubkeys + RegistryDeleteKeyRecursive HKEY_LOCAL_MACHINE, strSyncRootManagerKeyPath & "\" & strSubkey + Next + End If +End Function + +Function RegistryCleanup() + RegistryCleanupSyncRootManager() +End Function diff --git a/admin/win/msi/UinstallOldClientDlg.wxs b/admin/win/msi/UinstallOldClientDlg.wxs new file mode 100644 index 000000000000..f1e54e142545 --- /dev/null +++ b/admin/win/msi/UinstallOldClientDlg.wxs @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/admin/win/msi/make-msi.bat.in b/admin/win/msi/make-msi.bat.in index eb14735327fd..29b426e9aabb 100644 --- a/admin/win/msi/make-msi.bat.in +++ b/admin/win/msi/make-msi.bat.in @@ -17,10 +17,10 @@ Rem Generate collect.wxs if %ERRORLEVEL% neq 0 exit %ERRORLEVEL% Rem Compile en-US (https://www.firegiant.com/wix/tutorial/transforms/morphing-installers/) -"%WIX%\bin\candle.exe" -dcodepage=1252 -dPlatform=%BuildArch% -arch %BuildArch% -dHarvestAppDir="%HarvestAppDir%" -ext WixUtilExtension NCMsiHelper.wxs WinShellExt.wxs collect.wxs Nextcloud.wxs RegistryCleanupCustomAction.wxs +"%WIX%\bin\candle.exe" -dcodepage=1252 -dPlatform=%BuildArch% -arch %BuildArch% -dHarvestAppDir="%HarvestAppDir%" -ext WixUtilExtension NCMsiHelper.wxs WinShellExt.wxs collect.wxs Nextcloud.wxs RegistryCleanupCustomAction.wxs UinstallOldClientDlg.wxs if %ERRORLEVEL% neq 0 exit %ERRORLEVEL% Rem Link MSI package -"%WIX%\bin\light.exe" -sw1076 -ext WixUIExtension -ext WixUtilExtension -cultures:en-us NCMsiHelper.wixobj WinShellExt.wixobj collect.wixobj Nextcloud.wixobj RegistryCleanupCustomAction.wixobj -out "@MSI_INSTALLER_FILENAME@" +"%WIX%\bin\light.exe" -sw1076 -ext WixUIExtension -ext WixUtilExtension -cultures:de-de NCMsiHelper.wixobj WinShellExt.wixobj collect.wixobj Nextcloud.wixobj UinstallOldClientDlg.wixobj RegistryCleanupCustomAction.wixobj -out "@MSI_INSTALLER_FILENAME@" exit %ERRORLEVEL%