Skip to content

Commit

Permalink
Fix Custom Taskbar from breaking on Win 11
Browse files Browse the repository at this point in the history
  • Loading branch information
emtuls committed Oct 2, 2024
1 parent 6b95e46 commit 1bba109
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/common.vm/common.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>common.vm</id>
<version>0.0.0.20240826</version>
<version>0.0.0.20241002</version>
<description>Common libraries for VM-packages</description>
<authors>Mandiant</authors>
</metadata>
Expand Down
3 changes: 3 additions & 0 deletions packages/common.vm/tools/vm.common/vm.common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,9 @@ public class Shell {
$SHCNE_ASSOCCHANGED = 0x08000000
$SHCNF_IDLIST = 0
[void][Shell]::SHChangeNotify($SHCNE_ASSOCCHANGED, $SHCNF_IDLIST, [IntPtr]::Zero, [IntPtr]::Zero)

# Refresh the Taskbar
Stop-Process -Name explorer -Force # This restarts the explorer process so that the new taskbar is displayed.
} catch {
VM-Write-Log-Exception $_
}
Expand Down
2 changes: 1 addition & 1 deletion packages/installer.vm/installer.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>installer.vm</id>
<version>0.0.0.20240402</version>
<version>0.0.0.20240912</version>
<authors>Mandiant</authors>
<description>Generic installer for custom virtual machines.</description>
<dependencies>
Expand Down
9 changes: 0 additions & 9 deletions packages/installer.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ try {
}
VM-Write-Log "INFO" "Packages installation complete"

## Configure taskbar with custom Start Layout if it exists.
$customLayout = Join-Path ${Env:VM_COMMON_DIR} "CustomStartLayout.xml"
if (Test-Path $customLayout) {
Import-StartLayout -LayoutPath $customLayout -MountPath "C:\"
Stop-Process -Name explorer -Force # This restarts the explorer process so that the new taskbar is displayed.
} else {
VM-Write-Log "WARN" "CustomStartLayout.xml missing. No items will be pinned to the taskbar."
}

# Set Profile/Version specific configurations
VM-Write-Log "INFO" "Beginning Windows OS VM profile configuration changes"
$configPath = Join-Path $Env:VM_COMMON_DIR "config.xml" -Resolve
Expand Down

0 comments on commit 1bba109

Please sign in to comment.