View Single Post
Old 24th June 2022, 23:17   #54
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,522
SysCompImg::GetSysDpi first tries GetDpiForSystem and if it's not there it falls back to the GetDC code I posted earlier in this thread. For systems where DPI awareness is a thing it reports the DPI of the process. On older systems there is just one global DPI value and it returns that (< Vista). The global is usually 96 on old systems but can be set to 120. The plug-in does not care how you became aware.

Awareness requires "ManifestDPIAware true" or System::Call 'USER32::SetProcessDPIAware()i.r0' in .onInit. Microsoft recommends the manifest method but calling the function depending on a condition is the only way to make it dynamic. NSIS might display the unpacking dialog before .onInit in large installers and that could in theory break SetProcessDPIAware FYI.

If you are OK with losing some of the left side of the image you could try the AspectFitHeight image stretch mode.

If you choose to be unaware, "ManifestGdiScaling true" is supposed to make the text less blurry in some cases (192 dpi). This setting is undocumented because it was never tested enough to see if there are unwanted side-effects. See

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote