*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build: Powershell Studio 2021 5.8.187
Operating system: Windows 10 Pro 20H2 64-bit
PowerShell version(s): 5.1.19041.1645
32-bit version of software?
I'm having a bit of an issue with installing a service created through Powershell Studio. The service isn't very complex, and if I execute the code in a while-loop in normal Windows Powershell ISE, it works fine and I can blatantly enjoy my coffee.
Now I've spotted the possibility to create an MSI to install the service. So of course the curious and lazy lad I am, I tried to get that working. I've added some screenshots for you to see my configuration. I am not really sure what is important in this case, so I just made a few screenshots of the Installer Configuration, since I think that's the one I need for the msi Installer. At least was that my interpretation. If that is not the case, I would be obliged to learn differently. Please note that I am not yet very experienced with this, so please apologise any... ahem... inelegant configurations.
However, when I install it, I cant start it. According to the system Windows Log, the Service is not a valid Win32 Application. I tried various configurations in the installer configuration. However, there was more the strategy of "let's see what this button does'.
Any Ideas on how to troubleshoot or even solve this cheeky problem?
Thanks in advance
Powershell Windows Service - Not a valid Win32 Application
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.
-
- Posts: 6
- Last visit: Sat Apr 06, 2024 3:20 am
Powershell Windows Service - Not a valid Win32 Application
- Attachments
-
- 2022-05-02 15_40_17-cockpit_Service.psproj.psbuild - SAPIEN Script Packager.png (8.71 KiB) Viewed 7909 times
-
- 2022-05-02 15_40_10-cockpit_Service.psproj.psbuild - SAPIEN Script Packager.png (18.83 KiB) Viewed 7909 times
-
- 2022-05-02 15_40_02-cockpit_Service.psproj.psbuild - SAPIEN Script Packager.png (18.25 KiB) Viewed 7909 times
Re: Powershell Windows Service - Not a valid Win32 Application
From your screenshots, I do not see your executable listed in Files and Folders. Please try adding it and then rebuilding your MSI.
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 6
- Last visit: Sat Apr 06, 2024 3:20 am
Re: Powershell Windows Service - Not a valid Win32 Application
Thanks for your fast response
So do I understand this correctly: For this to work, I need the executable, which I package, included in the files and folders of the msi installer? Now that you're saying, starting to make sense I suppose. Do I also need to add the startup.pss and the needed ps1 files in the (which I dot source in startup.pss) in the files and folders? Or is it enough to check "Resolve and include external scripts" at Output Settings of the packager configuration?
EDIT:
I've included the pss and the exe which I package before, doesnt work. More Screenshots ahead. I've now also added some screenshots of the Packager Configuration
So do I understand this correctly: For this to work, I need the executable, which I package, included in the files and folders of the msi installer? Now that you're saying, starting to make sense I suppose. Do I also need to add the startup.pss and the needed ps1 files in the (which I dot source in startup.pss) in the files and folders? Or is it enough to check "Resolve and include external scripts" at Output Settings of the packager configuration?
EDIT:
I've included the pss and the exe which I package before, doesnt work. More Screenshots ahead. I've now also added some screenshots of the Packager Configuration
- Attachments
-
- 2022-05-02 16_41_13-cockpit_Service.psproj.psbuild - SAPIEN Script Packager.png (13.86 KiB) Viewed 7892 times
-
- 2022-05-02 16_41_03-cockpit_Service.psproj.psbuild - SAPIEN Script Packager.png (32.8 KiB) Viewed 7892 times
-
- 2022-05-02 16_40_53-cockpit_Service.psproj.psbuild - SAPIEN Script Packager.png (13.57 KiB) Viewed 7892 times
Re: Powershell Windows Service - Not a valid Win32 Application
Yes, your executable needs to be listed under Files and Folders.
You do not need to add the original project files if you made an executable unless they were included in the project as 'Content'.
When a project builds, it makes a script comprised of all the files included in the project with the Build setting set to 'Include'.
For more information on project settings and the Build setting, you may find the following article helpful:
https://www.sapien.com/blog/2022/03/15/ ... roduction/
The "Resolve and Include external scripts" is for any dot sources files. If script about to be packaged has dot sourced files, the code for those files is embedded into the script at the location of the dot sourced line.
You do not need to add the original project files if you made an executable unless they were included in the project as 'Content'.
When a project builds, it makes a script comprised of all the files included in the project with the Build setting set to 'Include'.
For more information on project settings and the Build setting, you may find the following article helpful:
https://www.sapien.com/blog/2022/03/15/ ... roduction/
The "Resolve and Include external scripts" is for any dot sources files. If script about to be packaged has dot sourced files, the code for those files is embedded into the script at the location of the dot sourced line.
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 6
- Last visit: Sat Apr 06, 2024 3:20 am
Re: Powershell Windows Service - Not a valid Win32 Application
Alright, thank you for the explanation. The Fog of ignorance seems to be lifting. I've now done as you described, and the error still persists. Any other ideas?
Re: Powershell Windows Service - Not a valid Win32 Application
Try changing it so there is only one executable file in Files and Folders with the executable listed first. If you need both 32 and 64 bit, you may need to make two different installers.
Clean the output folder and then rebuild. Do you still get the same error?
Is so, can you please upload your project files here:
https://www.sapien.com/support/upload
Clean the output folder and then rebuild. Do you still get the same error?
Is so, can you please upload your project files here:
https://www.sapien.com/support/upload
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 6
- Last visit: Sat Apr 06, 2024 3:20 am
Re: Powershell Windows Service - Not a valid Win32 Application
Cheers, that fixed it. Needed the executable first. Thank you very much for your help and I wish you good luck on your journeybrittneyr wrote: ↑Mon May 02, 2022 1:32 pm Try changing it so there is only one executable file in Files and Folders with the executable listed first. If you need both 32 and 64 bit, you may need to make two different installers.
Clean the output folder and then rebuild. Do you still get the same error?
Is so, can you please upload your project files here:
https://www.sapien.com/support/upload