Hi,
Simple question: how do I run a ps1 in a project (msi builder) hidden?
Found some explanation https://info.sapien.com/index.php/how-t ... si-builder
=> I have some custom actions which run a cmd and a ps1, for both I don't have an option to set it to hidden. Tried the -WindowStyle hidden but that didn't work.
J
MSI builder: set run of ps1/cmd hidden
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
- Alexander Riedel
- Posts: 8472
- Last visit: Mon Mar 18, 2024 2:59 pm
- Been upvoted: 37 times
Re: MSI builder: set run of ps1/cmd hidden
Windows installer does not have an option to run a console process hidden as far as I know. If it is a PowerShell script, you can package it as a silent exe and use that as your custom action.
As far as CMD goes, there is no direct option. Maybe you can call that from your silent exe, that should give you more options to run it hidden.
As far as CMD goes, there is no direct option. Maybe you can call that from your silent exe, that should give you more options to run it hidden.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: MSI builder: set run of ps1/cmd hidden
Making exe from each script is not the way I want to go since I'm editing/testing them all the time.
>You mention "Maybe you can call that from your silent exe, that should give you more options to run it hidden."
How should I do that?
>You mention "Maybe you can call that from your silent exe, that should give you more options to run it hidden."
How should I do that?
Re: MSI builder: set run of ps1/cmd hidden
Maybe I could run just 1 ps1 that calls all the other in silent mode?
Then I could finally convert this ps1 to an exe and call it from the msi?
Then I could finally convert this ps1 to an exe and call it from the msi?
- Alexander Riedel
- Posts: 8472
- Last visit: Mon Mar 18, 2024 2:59 pm
- Been upvoted: 37 times
Re: MSI builder: set run of ps1/cmd hidden
That is what I was implying.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: MSI builder: set run of ps1/cmd hidden
But how then run the cmd silent?
I need to set set-executionpolicy before I can run any scripts, I do that via the cmd (or can it be done differently?). This cmd also runs/pops up in the msi installer as first to run.
How can I get that silent?
I need to set set-executionpolicy before I can run any scripts, I do that via the cmd (or can it be done differently?). This cmd also runs/pops up in the msi installer as first to run.
How can I get that silent?
- Alexander Riedel
- Posts: 8472
- Last visit: Mon Mar 18, 2024 2:59 pm
- Been upvoted: 37 times
Re: MSI builder: set run of ps1/cmd hidden
Start-process has everything you need.
https://docs.microsoft.com/en-us/powers ... rshell-7.2
A packaged exe is not subject to script execution policy. You can also launch powershell.exe with -executionpolicy bypass,
which is used for a custom action from the MSI if you check the appropriate box in the custom action box.
https://docs.microsoft.com/en-us/powers ... rshell-7.2
A packaged exe is not subject to script execution policy. You can also launch powershell.exe with -executionpolicy bypass,
which is used for a custom action from the MSI if you check the appropriate box in the custom action box.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: MSI builder: set run of ps1/cmd hidden
Thanks but doesn't work for me. Script isn't executed during msi installer. It does when I run a powershell ... set-executionpolicy -unrestrcited via cmd
Re: MSI builder: set run of ps1/cmd hidden
Also, when I create an exe of the ps1 via ps2exe and add it to the project, it pops up btw. It's not silent.
- Alexander Riedel
- Posts: 8472
- Last visit: Mon Mar 18, 2024 2:59 pm
- Been upvoted: 37 times
Re: MSI builder: set run of ps1/cmd hidden
For one, I did not say anything about ps2exe. That is not the SAPIEN Script packager. So I would not tell you to use that.
Secondly, from the screenshot, this looks to be something other than a current version.
So why don't we start with what SAPIEN Software and what version do you actually have?
Secondly, from the screenshot, this looks to be something other than a current version.
So why don't we start with what SAPIEN Software and what version do you actually have?
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.