Skip to content

Commit f09f023

Browse files
(maint) Merge up d7a3cd1 to main
Generated by CI * commit 'd7a3cd1e46668c055fcc0a6856c5e44d2d401bb9': (PA-3843) Add `Enable Long Path Names` checkbox at the EndDialog window, which adds the LongPathsEnabled registry key, and sets its value to 1
2 parents ddf3fa3 + d7a3cd1 commit f09f023

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

resources/windows/wix/customactions.wxs.erb

+12
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,21 @@ End If
253253
<%-if @platform.architecture == "x86"-%>
254254
<Property Id="WixQuietExecCmdLine" Value="&quot;[%WINDIR]\System32\WindowsPowerShell\v1.0\powershell.exe&quot; -NoLogo -NonInteractive -InputFormat None -NoProfile -ExecutionPolicy Bypass -Command &quot;if (Test-Path -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components') { Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components' -Recurse | foreach { foreach ($prop in $_.Property) { if($_.GetValue($prop) -like '*service\nssm.exe*') { Set-ItemProperty -Path $_.PSPath -Name $prop -Value '' -ErrorAction Stop } } }; Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components' -Recurse | foreach { foreach ($prop in $_.Property) { if($_.GetValue($prop) -like '*puppet\bin\nssm.exe*') { Set-ItemProperty -Path $_.PSPath -Name $prop -Value '' -ErrorAction Stop } } } }&quot;"/>
255255
<CustomAction Id="RemoveLegacyNssmRegistryKey" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="immediate" Return="check"/>
256+
<Property Id="WixSilentExecCmdLine" Value="&quot;[%WINDIR]\System32\WindowsPowerShell\v1.0\powershell.exe&quot; try {$check_long_path_enabled = Get-ItemProperty -Path &quot;HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem&quot; | Select-Object -ExpandProperty &quot;LongPathsEnabled&quot; -ErrorAction Stop;if($check_long_path_enabled -ne 1 ){throw &quot;Value needs to be 1&quot;}} catch { New-ItemProperty -Path &quot;HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem&quot; -Name &quot;LongPathsEnabled&quot; -Value 1 -PropertyType DWORD -Force }"/>
257+
<CustomAction Id="EnableLongPathName"
258+
BinaryKey="WixCA"
259+
DllEntry="WixSilentExec"
260+
Execute="immediate"
261+
Impersonate="yes" />
256262
<%-else-%>
257263
<Property Id="WixQuietExec64CmdLine" Value="&quot;[%WINDIR]\System32\WindowsPowerShell\v1.0\powershell.exe&quot; -NoLogo -NonInteractive -InputFormat None -NoProfile -ExecutionPolicy Bypass -Command &quot;if (Test-Path -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components') { Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components' -Recurse | foreach { foreach ($prop in $_.Property) { if($_.GetValue($prop) -like '*service\nssm.exe*') { Set-ItemProperty -Path $_.PSPath -Name -Value '' $prop -ErrorAction Stop } } }; Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components' -Recurse | foreach { foreach ($prop in $_.Property) { if($_.GetValue($prop) -like '*puppet\bin\nssm.exe*') { Set-ItemProperty -Path $_.PSPath -Name $prop -Value '' -ErrorAction Stop } } } }&quot;"/>
258264
<CustomAction Id="RemoveLegacyNssmRegistryKey" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="immediate" Return="check"/>
265+
<Property Id="WixSilentExec64CmdLine" Value="&quot;[%WINDIR]\System32\WindowsPowerShell\v1.0\powershell.exe&quot; try{$check_long_path_enabled = Get-ItemProperty -Path &quot;HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem&quot; | Select-Object -ExpandProperty &quot;LongPathsEnabled&quot; -ErrorAction Stop;if($check_long_path_enabled -ne 1 ){throw &quot;Value needs to be 1&quot;}} catch { New-ItemProperty -Path &quot;HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem&quot; -Name &quot;LongPathsEnabled&quot; -Value 1 -PropertyType DWORD -Force }"/>
266+
<CustomAction Id="EnableLongPathName"
267+
BinaryKey="WixCA"
268+
DllEntry="WixSilentExec64"
269+
Execute="immediate"
270+
Impersonate="yes" />
259271
<%-end-%>
260272

261273
<!-- Due to PUP-6729, system may not have permission to modify DACL, so first take ownership -->

resources/windows/wix/properties.wxs.erb

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
Id="WIXUI_EXITDIALOGOPTIONALTEXT"
5151
Value="Manage your first resources on this node, explore the Puppet community and get support using the shortcuts in the Documentation folder of your Start Menu." />
5252

53+
<Property
54+
Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
55+
Value="Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)" />
56+
5357
<!-- ***NOTE***
5458
When originally moving to vanagon builds of puppet-agent (specifically for 1.6.0 and 1.6.1),
5559
we wrote several registry entries to the wrong place. We fixed the issue in 1.6.2, but in order

resources/windows/wix/sequences.wxs.erb

+3-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@
150150
<Custom Action='SetFromIniPuppetServerPort' Before='FileCost'>
151151
INI_PUPPET_SERVER_PORT AND NOT PUPPET_SERVER_PORT
152152
</Custom>
153-
153+
<Custom Action='EnableLongPathName' Before='InstallFiles'>
154+
ENABLE_LONG_PATHS
155+
</Custom>
154156
<!-- Due to PUP-6729, make sure admins and system have permision to reset permissions -->
155157
<!-- Also resets permissions for children beneath each appdir -->
156158
<Custom Action='ResetDataPermissions' After='InstallFiles'>

resources/windows/wix/ui/WixUI_PuppetInstallDir.wxs.erb

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Patch dialog sequence:
5959
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
6060

6161
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
62+
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="EnableLongPathName" Order="999">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1</Publish>
6263

6364
<Publish Dialog="PuppetWelcomeDlg" Control="Next" Event="NewDialog" Value="PuppetLicenseAgreementDlg" Order="1"><![CDATA[NOT Installed]]></Publish>
6465
<Publish Dialog="PuppetWelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="1"><![CDATA[Installed AND PATCH]]></Publish>
@@ -93,6 +94,7 @@ Patch dialog sequence:
9394
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
9495

9596
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
97+
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="EnableLongPathName" Order="999">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1</Publish>
9698

9799
<Publish Dialog="PuppetWelcomeDlg" Control="Next" Event="NewDialog" Value="PuppetLicenseAgreementDlg" Order="1"><![CDATA[NOT VersionNT64 AND NOT Installed]]></Publish>
98100
<Publish Dialog="PuppetWelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="1"><![CDATA[NOT VersionNT64 AND Installed AND PATCH]]></Publish>

0 commit comments

Comments
 (0)