Compile to EXE results in form that is larger than designed

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
dl_escan@alliantenergy.com
Posts: 5
Last visit: Thu Aug 05, 2021 6:26 am

Compile to EXE results in form that is larger than designed

Post by dl_escan@alliantenergy.com »

Product, version and build: PowerShell Studio 2016 5.2.122
32 or 64 bit version of product: 64
Operating system: 2012 R2
32 or 64 bit OS: 64
PowerShell Version: 4

Prior to purchasing PS Studio, we built many GUI based scripts by hand that work fine, but figured it might be better to make them into an EXE. When I compile these scripts into an EXE with PS Studio 2016, the resulting form shown from the EXE is a different size and alignment from my original design. There is a larger gap for example between the right edge of the controls and the right edge of the form making it look all lop-sided and off-center. Functionally it works - just looks goofy. Why does a compiled EXE change the dimensions of my form?
Thanks
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Compile to EXE results in form that is larger than designed

Post by DevinL »

Could you upload one of the scripts that this happens with? If you don't wish for it to be public you can upload it to https://sapien.com/support/upload and we'll take a look at it.
DevinL
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Compile to EXE results in form that is larger than designed

Post by Alexander Riedel »

Screenshots illustrating the difference would be great too, just in case the effect is on a particular machine or screen only.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
dl_escan@alliantenergy.com
Posts: 5
Last visit: Thu Aug 05, 2021 6:26 am

Re: Compile to EXE results in form that is larger than designed

Post by dl_escan@alliantenergy.com »

So after a little closer observation, I would say the form itself is not bigger. But rather all the controls in the form are compressed closer together and shrunk, anchored at the top left of the form...leaving larger gap between the right and bottom edges of the form. This made it look like the form is bigger...but really it is the same size. I am guessing the space between the controls and the size of them is at a smaller ratio compared to the original design.

I have attached a screenshot. The left form is the EXE and I highlighted in yellow the larger gap to the right and bottom. Its not a big deal, just kind of annoying I spent all that time manually lining up the controls and now the odd looking after the conversion to EXE. If there is a solution to this - cool...if not, no biggy.
Thanks
Attachments
Sapien.png
Sapien.png (19.96 KiB) Viewed 2492 times
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Compile to EXE results in form that is larger than designed

Post by Alexander Riedel »

The real difference here is the frame style. The form is actually the same, apart from some button alignment.
Most likely the difference is visible because when you run the script from a console it does not use the modern UI libs and styles, basically giving it an XP style frame. The manifest of our packaged exe's tag the exe file to use a more modern version of the Microsoft.Windows.Common-Controls, so that will cause a difference in the frame.
I do not have 2012 machine handy, but if you package without a manifest (not really recommended) you could potentially force it back to the old style.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
dl_escan@alliantenergy.com
Posts: 5
Last visit: Thu Aug 05, 2021 6:26 am

Re: Compile to EXE results in form that is larger than designed

Post by dl_escan@alliantenergy.com »

Ah yes - I totally missed the border/frame width. Good catch.

Thanks for the time.
This topic is 7 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.