Last active
June 24, 2023 23:30
-
-
Save NickCraver/c30e4f701d01f1ca90672c4e625253be to your computer and use it in GitHub Desktop.
PowerShell: SSMS 16 & 17 HiDPI Enable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"><asmv3:application><asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"><dpiAware>True</dpiAware></asmv3:windowsSettings></asmv3:application><dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /></dependentAssembly></dependency><dependency><dependentAssembly><assemblyIdentity type="win32" name="debuggerproxy.dll" processorArchitecture="X86" version="1.0.0.0"></assemblyIdentity></dependentAssembly></dependency></assembly>'; | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide" -Name PreferExternalManifest -Value 1 -Type DWord; | |
$ssms16 = "C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Ssms.exe"; | |
if ((Test-Path $ssms16)) { $xml | Out-File -FilePath "$ssms16.manifest" -Encoding UTF8; } | |
$ssms17 = "C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Ssms.exe"; | |
if ((Test-Path $ssms17)) { $xml | Out-File -FilePath "$ssms17.manifest" -Encoding UTF8; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does the
PreferExternalManifest
Registry setting open an attack surface, since it appears to apply to all executables?Also, you might consider saving off a copy of the old manifest file before overwriting it -- just in case.