Gui application feature not working via MSI installation

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.
EddiePecanha
Posts: 3
Last visit: Sat Jun 19, 2021 7:41 pm

Gui application feature not working via MSI installation

Post by EddiePecanha »

Product, version and build: PowerShell Studio 2021 5.8.188.0
Operating system: Windows 10 Enterprise
PowerShell version(s): 5.1.18362.752

The below command works fine running from the designer, however, it doesn't work after building the app and deploying via MSI, all other options are working properly.

$ie = new-object -com InternetExplorer.Application
$ie.ToolBar = 0
$ie.Navigate2("bla,bla,bla);
Attachments
Sapien IE Issue.PNG
Sapien IE Issue.PNG (161.31 KiB) Viewed 4652 times

User avatar
brittneyr
Site Admin
Posts: 797
Last visit: Mon Jun 21, 2021 11:50 am
Answers: 15
Been upvoted: 11 times

Re: Gui application feature not working via MSI installation

Post by brittneyr »

I have found no issues packaging and deploying a script with the following code:
$ie = new-object -ComObject "InternetExplorer.Application"
$ie.Visible = $true
$ie.ToolBar = 0
$ie.navigate2('google.com')

If you are navigating to a html document, make sure the executable is able to find it.
What type of engine are trying to package with? (Command line, Winforms, etc)
Does your executable run fine outside of PowerShell Studio before deploying via MSI?
Brittney Ryn
SAPIEN Technologies, Inc.

EddiePecanha
Posts: 3
Last visit: Sat Jun 19, 2021 7:41 pm

Re: Gui application feature not working via MSI installation

Post by EddiePecanha »

Hey Brittneyr :D

The command works fine outside PowerShell Studio using only PowerShell and also via the PowerShell Studio in designer mode, whatever, it fails to display the IE page after building and installing via MSI, it looks like something is not working properly during the packaging process.

I build the package as Windows Application and Script Application with the same results.

Thanks for your help :D

User avatar
brittneyr
Site Admin
Posts: 797
Last visit: Mon Jun 21, 2021 11:50 am
Answers: 15
Been upvoted: 11 times

Re: Gui application feature not working via MSI installation

Post by brittneyr »

What is the actual url you are attempting to navigate to? If it is an html file, please make sure it is included with the installer.
If your script is packaged to an executable and not running after deploying, is there any errors in the event log?
Does your executable run as expected without any errors in the Tools Output pane from PowerShell Studio from the ribbon
(Home->Build and Run->Package):
SPS_RibbonBuildAndRun.png
SPS_RibbonBuildAndRun.png (42.21 KiB) Viewed 4628 times
Also, please verify that the machine you are deploying to has IE installed.
Brittney Ryn
SAPIEN Technologies, Inc.

EddiePecanha
Posts: 3
Last visit: Sat Jun 19, 2021 7:41 pm

Re: Gui application feature not working via MSI installation

Post by EddiePecanha »

It's working now :D

I was creating 2 exes with different names, 1 from the packager task pane and another from the installer task pane.

Creating just 1 exe file with the same name fixed the problem.

Now I need to figured out how to create a desktop shortcut :D

Thanks for your help
Attachments
Sapien Panes.PNG
Sapien Panes.PNG (33.77 KiB) Viewed 4611 times

User avatar
brittneyr
Site Admin
Posts: 797
Last visit: Mon Jun 21, 2021 11:50 am
Answers: 15
Been upvoted: 11 times

Re: Gui application feature not working via MSI installation

Post by brittneyr »

This can be done with two custom actions: One to create the shortcut on install and one to delete the shortcut on delete.

Though this blog is a little older, it has scripts for creating and removing a desktop shortcut:
https://www.sapien.com/blog/2019/08/15/ ... xecutable/
Brittney Ryn
SAPIEN Technologies, Inc.