Add ps exe to custom actions
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.
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.
-
- Posts: 15
- Last visit: Mon May 29, 2023 6:03 am
Re: Add ps exe to custom actions
That was my typo, I guess I need a bigger monitor, lol. I'll give it a try and let you know, thanks.
-
- Posts: 15
- Last visit: Mon May 29, 2023 6:03 am
Re: Add ps exe to custom actions
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.
- Alexander Riedel
- Posts: 8283
- Last visit: Fri Jun 09, 2023 11:35 pm
- Been upvoted: 30 times
Re: Add ps exe to custom actions
$form1.Activate();
in the form load event handler should do it.
in the form load event handler should do it.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 15
- Last visit: Mon May 29, 2023 6:03 am
Re: Add ps exe to custom actions
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.
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.
- Alexander Riedel
- Posts: 8283
- Last visit: Fri Jun 09, 2023 11:35 pm
- Been upvoted: 30 times
Re: Add ps exe to custom actions
All SAPIEN Hosts use a variable $ExitCode to return a value through the host.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 15
- Last visit: Mon May 29, 2023 6:03 am
Re: Add ps exe to custom actions
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.
-
- Posts: 15
- Last visit: Mon May 29, 2023 6:03 am
Re: Add ps exe to custom actions
Also, should the installer automatically add the program entry to the start menu, or do I need a Custom action for that?
- Alexander Riedel
- Posts: 8283
- Last visit: Fri Jun 09, 2023 11:35 pm
- Been upvoted: 30 times
Re: Add ps exe to custom actions
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.
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.
SAPIEN Technologies, Inc.