From a2b4ee90582444472e0c62743239786e0b0111de Mon Sep 17 00:00:00 2001 From: Eugen Fischer Date: Wed, 27 Mar 2024 23:12:10 +0100 Subject: [PATCH] Setup modifications --- admin/win/msi/CMakeLists.txt | 2 + admin/win/msi/License.rtf | Bin 0 -> 6522 bytes admin/win/msi/Nextcloud.wxs | 88 ++++++++++++++++++++++--- admin/win/msi/OEM.wxi.in | 6 +- admin/win/msi/RegistryCleanup.vbs | 54 +++++++++++++++ admin/win/msi/UinstallOldClientDlg.wxs | 52 +++++++++++++++ admin/win/msi/make-msi.bat.in | 4 +- 7 files changed, 192 insertions(+), 14 deletions(-) create mode 100644 admin/win/msi/License.rtf create mode 100644 admin/win/msi/RegistryCleanup.vbs create mode 100644 admin/win/msi/UinstallOldClientDlg.wxs 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 0000000000000000000000000000000000000000..c5550a6c51b09c7bc5ea2ac00a507135ff74308b GIT binary patch literal 6522 zcmbVRU2oe+61?XH_CE~nCHBGbNwVYY-99DpM-0cgMZC!Z2fdJDQ{svoDlc=BR0Eu<_*Q`>gctZi0V;DtJ~ z^YQ59r2k$De|?#jtqmcs@ntkEZBFVlZa=VHZWp>^g%HCsqA8JY3ucyv7e>Evwkb$VaP zdRf`xblT0v=EonVtIQP|m7h$^yJ{nLlS@(Ad1o<|nLhjJ^ftq{kiB{LpO5Dz>q=8d zV}5z_cgBjx<0SaR-kxPI&DgxE>$x;iS@Che_}H9RV$P)t9zmI3rIuyem{(WkplZx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|!0nMjE+0No=AsI?IGCFF&9&DL8<2I~qQK%u=! z8q%MEUg<@Z#CMc$CY}9*jVtxY*f<&3kVnXvm0sA65H4&&6`Ezr;Loq$YeoEXcOLUz zOWEa@H&UAf&IM;&5G` zg-wif?$|*9^@SUXM-S++Yp3cfQDe&h#-x~3ATOv93VJX=o?X_X+eyw2GeWNv{SpGk z?9Y~)ZfGb#AeJa|&99wR+0eR!U4Ih|ZUP=io<0`&Q<3nU2|bbd`~)patp|(j9g4={ zaL4aAstAzMq&^&eCFn5d{iwxZ1#(}8^S2$GpZ5^M3O?Zcm|3b%Qsg-F1S7Cg}^>UuQGWsaX4 zG#3|t6*nW*P5HLQRK$xjTsTdm_G?Ol))kZ+eM5tU^7Ia(^YuZ>H*PA{h+Tv0%VLpr zD=Yyw#Yfx~1qvX=l`wut8xXs2+W$VBO;2wi3+6O(Ql<&W;0pb9}WStRCBhYs;<>{%PKdqW3bwDOqalks+2aACXD^h-RWJoM()z}y=$3({5oLiLJg&#nj7q9H!U9L* zXjkcz$NiV|1?15$(ItDSZM=7fcsV~fzQIMIYo|BET$KcU?0q!f=DMZNnuv*Ztk^C~ zC0^;9ZQr8z>!Z^7RNAh{OTI@^qa;DLi2DD9plj~z6K8f?{2Q&nMjApr8BKQnB!T&fWqX-KA&iLE^0Bq+g*Z=?k literal 0 HcmV?d00001 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%