Page 1 of 1

Gui application feature not working via MSI installation

Posted: Thu Apr 29, 2021 7:42 am
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);

Re: Gui application feature not working via MSI installation

Posted: Thu Apr 29, 2021 8:43 am
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?

Re: Gui application feature not working via MSI installation

Posted: Thu Apr 29, 2021 9:26 am
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

Re: Gui application feature not working via MSI installation

Posted: Thu Apr 29, 2021 9:48 am
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 5525 times
Also, please verify that the machine you are deploying to has IE installed.

Re: Gui application feature not working via MSI installation

Posted: Thu Apr 29, 2021 12:24 pm
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

Re: Gui application feature not working via MSI installation

Posted: Fri Apr 30, 2021 7:21 am
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/