Add ps exe to custom actions

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 10 months and 3 days 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.
Epoch55systems
Posts: 21
Last visit: Sun Jan 07, 2024 5:33 pm

Re: Add ps exe to custom actions

Post by Epoch55systems »

That was my typo, I guess I need a bigger monitor, lol. I'll give it a try and let you know, thanks.
Epoch55systems
Posts: 21
Last visit: Sun Jan 07, 2024 5:33 pm

Re: Add ps exe to custom actions

Post by Epoch55systems »

That worked, thank you! Regarding your comment about forcing the form to appear in front of the installer wizard, do you know how I could do that? Thanks.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Add ps exe to custom actions

Post by Alexander Riedel »

$form1.Activate();

in the form load event handler should do it.
Alexander Riedel
SAPIEN Technologies, Inc.
Epoch55systems
Posts: 21
Last visit: Sun Jan 07, 2024 5:33 pm

Re: Add ps exe to custom actions

Post by Epoch55systems »

Another question: I'm trying to add the exit code to terminate the install if an invalid product key is entered. I've tried using:
Exit 1
but that throws a unhandled exception.

$script.exitcode=1
but that doesn't return anything.

return 1 (and (write-output 1) prior to closing the form
but that does nothing either.

Any suggestions? Thanks.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Add ps exe to custom actions

Post by Alexander Riedel »

All SAPIEN Hosts use a variable $ExitCode to return a value through the host.
Alexander Riedel
SAPIEN Technologies, Inc.
Epoch55systems
Posts: 21
Last visit: Sun Jan 07, 2024 5:33 pm

Re: Add ps exe to custom actions

Post by Epoch55systems »

Thanks. If the custom action RegisterMyProduct is unable to register the product and I'm able to have the installer capture that, will I have to add another custom action to uninstall, remove all files copied to Program files, etc? Thanks.
Epoch55systems
Posts: 21
Last visit: Sun Jan 07, 2024 5:33 pm

Re: Add ps exe to custom actions

Post by Epoch55systems »

Also, should the installer automatically add the program entry to the start menu, or do I need a Custom action for that?
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Add ps exe to custom actions

Post by Alexander Riedel »

As for your first question, you cannot uninstall a product that is still being installed, no matter how you frame it.
You cannot actually run Windows Installer if it is already running for something else. Best you could do, is to schedule it.

Start menu items are added via the "Shortcuts" page. You can do that any which way you like, but there is no automatic mechanism because how would it know what you want to add and what not.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 10 months and 3 days 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.