This project is read-only.

Show-InstallationWelcome DPI aware?

Topics: Archive - General
Sep 3, 2014 at 11:46 AM
I have tested the script with the CloseApps parameter at different DPI setting and unfortunately the text was not readable and cut off in some cases.

Is the GUI part DPI aware?

We have users that run with different DPI settings and they will not be able to read the message on screen.

You can see an example below at the link below.
https://www.dropbox.com/s/895st1tqcm7uk2j/Welcome.png?dl=0

I am using version 3.15.
Sep 3, 2014 at 1:04 PM
No we're aware of this issue but no fix in planning. Feel free to raise as an issue and any help with resolution would be welcome.
Sep 3, 2014 at 1:41 PM
Edited Sep 3, 2014 at 1:45 PM
Here is a project written in C# that enables DPI awareness for all of the various flavors of Windows.
https://github.com/paulcbetts/permonitordpi

Here is their license: https://github.com/paulcbetts/PerMonitorDpi/blob/master/COPYING
Sep 3, 2014 at 6:14 PM
@Xploder

I wonder if it might not be possible to get around this issue by using Application Compatibility settings as described here:
http://www.verboon.info/2011/03/running-an-application-as-administrator-or-in-compatibility-mode/

The property to set in the registry is "HIGHDPIAWARE". This will disable display scaling on high DPI settings. You will have to set this property for the specific script file you are running. I'm hoping that means that the text doesn't and visual controls don't blow up and remain visible.
Oct 30, 2014 at 12:52 PM
I'd like to offer a potential solution to this. It doesn't make the app DPI-aware, but it does resolve the issue with text being clipped. Edits are to function Show-WelcomePrompt. All I've done is set the MaximumSize property on the label controls to fix the width but allow the height to vary, then enabled AutoSize for each one.

FIND:
    $labelAppName.Size = $System_Drawing_Size
AFTER, ADD:
    $System_Drawing_Size.Height = 0
    $labelAppName.MaximumSize = $System_Drawing_Size
FIND:
    $labelAppName.AutoSize = $false
REPLACE WITH:
    $labelAppName.AutoSize = $true
FIND:
    $labelDefer.Size = $System_Drawing_Size
AFTER, ADD:
    $System_Drawing_Size.Height = 0
    $labelDefer.MaximumSize = $System_Drawing_Size
FIND:
    $labelDefer.TextAlign = 'MiddleCenter'
AFTER, ADD:
    $labelDefer.AutoSize = $true
FIND:
    $labelCountdown.Size = $System_Drawing_Size
AFTER, ADD
    $System_Drawing_Size.Height = 0
    $labelCountdown.MaximumSize = $System_Drawing_Size
FIND:
    $labelCountdown.TextAlign = 'MiddleCenter'
AFTER, ADD:
    $labelCountdown.AutoSize = $true
Hope this helps someone!
Oct 30, 2014 at 1:20 PM
A similar fix is also required in Show-InstallationPrompt if you're using an icon in the dialog, otherwise this gets cropped.

FIND:
$pictureIcon.Size = $System_Drawing_Size

AFTER, ADD:
$pictureIcon.AutoSize = $true
Nov 4, 2014 at 1:09 AM
Thanks for this fix. It has been integrated into the toolkit with the latest 3.5.0 release.