Product: PowerShell Studio 2021 (64 Bit)
Build: v5.8.187
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.19042.0
PowerShell version(s): 5
I am having an issue packaging and running a script application. It worked in previous builds of Powershell Studio. I should start by saying that the script, a Windows Forms app, runs just fine in the editor. My modules are imported and everything just runs. I have "resolve and include external scripts" checked in my Output Settings. There used to be a way to manually include files in a package, at least I thought there was, maybe I am wrong. How do I package an .exe and create an .msi when I have ./modules to include?
My project directory has all the scripts that make up the app in the main project folder and the modules it uses in a modules folder in the main project folder.
Unable to package and run with custom modules
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.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Unable to package and run with custom modules
Modules cannot be included in an exe, that goes counter to the idea of a module. Dot sourced scripts of course are a different story.
From your description you would just need to include the modules folder in your MSI. On the Files and Folders tab you would need to add your modules folder.
From your description you would just need to include the modules folder in your MSI. On the Files and Folders tab you would need to add your modules folder.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Unable to package and run with custom modules
Maybe this is the wrong thread but I had the impression (falsely?) that Modules were like libraries. I use/reference these modules in other scripts. Often I just copy the modules to a new script and start building. I am actually currently reading about setting up a Module Repository in my organization and also just generally reading up on the proper use of modules.
Would/Does it make sense to have an .exe import/install those modules from a central repository or am I better served just changing them from a .psm1 file to a .ps1 file and Dot sourcing them and doing that in all my other scripts?
Would/Does it make sense to have an .exe import/install those modules from a central repository or am I better served just changing them from a .psm1 file to a .ps1 file and Dot sourcing them and doing that in all my other scripts?
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Unable to package and run with custom modules
"Libraries" is just as much of a loose term as "Modules"
I am actually working on a blog post attempting to explain the differences between using modules and dot sourcing.
If you don't need to change it right now this minute, would be able to wait for that another few days?
If not, the basic rule in my opinion is, if this is your own private affair and no on else is using this, dot source the files.
I am actually working on a blog post attempting to explain the differences between using modules and dot sourcing.
If you don't need to change it right now this minute, would be able to wait for that another few days?
If not, the basic rule in my opinion is, if this is your own private affair and no on else is using this, dot source the files.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Unable to package and run with custom modules
I can totally wait a few days! I need to add the Sapien blog to my RSS feed
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times