Product, version and build: PowerShell Studio 2018 v5.5.152
32 or 64 bit version of product: 64
Operating system: 64
32 or 64 bit OS: 64
When we build a PowerShell Module MSI the files are not in the correct Version Folder but in the base path:
Bad:
C:\Program Files\WindowsPowerShell\Modules\MyModule\
Good:
C:\Program Files\WindowsPowerShell\Modules\MyModule\1.1.4.19\
Of course we use the correct Version in all available fields.
If the installer cannot elevate, it should install into the users Module Path:
$env:HOMESHARE\..\WindowsPowerShell\Modules\\MyModule\1.1.4.19\
Could you please correct this behaviour - Thank you!
MSI Installer Module issues
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.
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: MSI Installer Module issues
In my experience, you will only see the code folder version (which is not required if using source control) on a project folder and not part of an application folder, nor a module folder. This can cause confusion to a user on which version to use. It need to be kept in the project folder where you tell the packager and msi from where to build the new version.
Look into our Source control tool SAPIEN's VersionRecall, which simplifies the process of creating backups and maintaining multiple versions of your files.
In my opinion the MSI is working as expected.
Look into our Source control tool SAPIEN's VersionRecall, which simplifies the process of creating backups and maintaining multiple versions of your files.
In my opinion the MSI is working as expected.
Re: MSI Installer Module issues
Well, it's standard for Powershell Modules so support multiple Versions! Get-Module will not work correctly otherwise!
I found a solution, by adding this to the WixModuleTemplate.txt and it works as it should!
Another question:
i would like to execute a powershell script inside the newly installed application. I tried a custom Action like:
My problem: i need to know how to specify the [VERSIONDIR] in this dialog!!
I found a solution, by adding this to the WixModuleTemplate.txt and it works as it should!
Code: Select all
<Directory Id="INSTALLDIR" Name="%PRODUCT%">
<Directory Id="VERSIONDIR" Name="%VERSION%">
%HEATCOMPONENTS%
</Directory>
</Directory>
i would like to execute a powershell script inside the newly installed application. I tried a custom Action like:
Code: Select all
powershell.exe
-NonInteractive -WindowStyle Hidden -ExecutionPolicy ByPass -File [VERSIONDIR]\install-PODIS.ps1
- Attachments
-
- 17-05-_2018_16-15-27.png (101.91 KiB) Viewed 2896 times
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: MSI Installer Module issues
Yes! PowerShell will support multiple version of the same module. I want to keep things simple or you ended up using module namespace.
I have a lot of issues with different versions of the same modules (AzureRM, SQLPS..). One thing in common, their installed module path is included in the $env:PSModulePath. But, still you'll need to use the module namespace to use the correct cmdlet.
Now, a good example of what you want to accomplished is "AzureRM". I'm thinking that the way the project was created may need to be rethink.
In AzureRM, I see the folder structure been:
.../module/AzureRM/5.2.0
Then, under the version number you'll see both the *psd1 and *psm1 files. Then, try do the packager and msi to see if it will give the proper installation.
I have a lot of issues with different versions of the same modules (AzureRM, SQLPS..). One thing in common, their installed module path is included in the $env:PSModulePath. But, still you'll need to use the module namespace to use the correct cmdlet.
Now, a good example of what you want to accomplished is "AzureRM". I'm thinking that the way the project was created may need to be rethink.
In AzureRM, I see the folder structure been:
.../module/AzureRM/5.2.0
Then, under the version number you'll see both the *psd1 and *psm1 files. Then, try do the packager and msi to see if it will give the proper installation.
Re: MSI Installer Module issues
Well, i solved it myself, so i won't waste your time with a feature request.
For people having the same requirement i post the solution:
Add this to the C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2018\MSIBuilder\WixModuleTemplate.txt
In MSI Settings - Custom Actions - Properties
File: powershell.exe
Folder: VERSIONDIR
Arguments:
This may not jet handle correct result code of yout script - wix doesn't like $, so this does NOT work:
For people having the same requirement i post the solution:
Add this to the C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2018\MSIBuilder\WixModuleTemplate.txt
Code: Select all
<Directory Id="INSTALLDIR" Name="%PRODUCT%">
<Directory Id="VERSIONDIR" Name="%VERSION%">
%HEATCOMPONENTS%
</Directory>
</Directory>
File: powershell.exe
Folder: VERSIONDIR
Arguments:
Code: Select all
-NonInteractive -WindowStyle Hidden -ExecutionPolicy ByPass -Command .\MyPostInstallScript.ps1
Code: Select all
...ps1 ; exit $LASTEXITCODE