Please Expand on MSI Prerequisite thread

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 6 years and 1 week 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.
User avatar
PXL_Posh
Posts: 40
Last visit: Thu Nov 07, 2019 5:43 am

Please Expand on MSI Prerequisite thread

Post by PXL_Posh »

Powershell Studio 2018
Windows 10
64 bit

Please expand on this thread: viewtopic.php?t=11853

In the response to this question Sapien suggests creating a function to run an MSI.

I have gone over the 4 part series on the Deploy method, but perhaps I need additional clarity.
Please include any documentation or youtube broadcasts that may clear things up for me.

MSI: What is the order of operations? Are the directories created and the files moved first? (ideal scenario for me)

Is it possible to execute any of the following 'MSI, Function, Script, EXE, etc' when the MSI is launched?

Is the creation of custom sub-directories and file paths within the Windows Application folder possible with standard MSI execution?

Is this a baked in module in Posh Studio 2018 or one I must create in my function?

Code: Select all

$path = Join-Path (Get-ScriptDirectory) 'MSIFile.msi'
msiexec.exe /i $path
Thank you for your continued support.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Mon Apr 15, 2024 3:28 pm
Answers: 20
Been upvoted: 37 times

Re: Please Expand on MSI Prerequisite thread

Post by Alexander Riedel »

Let me try to answer some of your questions. First and foremost, please understand that MSI (Microsoft Installer) is standard Windows component. So all pertinent documentation should be on a Microsoft site somewhere.

As for the order of operations, (https://en.wikipedia.org/wiki/Windows_Installer) generally there is a UI phase before the execute phase. Files are copied during the execute phase.
The current version of PowerShell Studio does not support custom actions yet, but PrimalScript does. (https://www.sapien.com/blog/2018/02/26/ ... i-builder/) This should be included in the next build of PowerShell Studio. The custom actions defined here are all executed AFTER and files or folders are copied / created.

You can create a custom folder structure and add additional custom files by providing your own staging folder with the structure and files desired.
That was added here: https://www.sapien.com/blog/2014/10/14/ ... ld-7-0-49/ and also applies to PowerShell Studio

You can of course execute any MSI or other function you need in the fashion mention on that other post. This is not 'baked in' in the sense that we don't know what you need.
Typically you would check in a form load event if you have everything you need and kick off anything custom there. Create folders, install modules, download data files etc.
If you want to do that during install time (installers run elevated after all), a custom action would be your best bet.

Your obvious next question is when the next service build of PowerShell Studio comes out. The short answer is, "I don't know". It is in QA so it should not be long, but one never knows.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PXL_Posh
Posts: 40
Last visit: Thu Nov 07, 2019 5:43 am

Re: Please Expand on MSI Prerequisite thread

Post by PXL_Posh »

I understand the custom folder structure.
Now I need to pursue
check in a form load event
procedure. I will look in the help files for further guidance.
Is this a form project? That seems to relate only to GUI projects. It seems maybe that is not the correct direction.

There are at least two sentences in your response that would lead me to believe what I want is not possible in the current version of PowerShell Studio 2018.

Would you mind clarifying?
User avatar
Alexander Riedel
Posts: 8488
Last visit: Mon Apr 15, 2024 3:28 pm
Answers: 20
Been upvoted: 37 times

Re: Please Expand on MSI Prerequisite thread

Post by Alexander Riedel »

Since you use PowerShell Studio I was assuming a form. Seeing your response I deduct that this is not the case.
I do not know if you can do what you want, because I do not know what you want :D
Maybe you can elaborate on what you need/want?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PXL_Posh
Posts: 40
Last visit: Thu Nov 07, 2019 5:43 am

Re: Please Expand on MSI Prerequisite thread

Post by PXL_Posh »

The main purpose of this project is to distribute a single binary GUI compiled from a script in PowerShell Studio 2018.
The binary has several programmatic requisites including PowerShell version 5. Powershell v5 upgrade is included in a custom folder and the intention is to install it in on the target system in the event the target system windows powershell version is below 5. The project build is configured to accept any version of powershell for this reason.

Since setting the MSI build option for minimum powershell version simply cancels the install when not met it seemed prudent to set it to no requirement and handle the poshv5 upgrade programmatically.

This main binary is being tracked by Add-Remove programs and has the version and Company information associated with it as configured in the MSI builder.

Two other applications are required by the Binary to function properly which may or may not be installed on the target system. Similarly, they will require detection and installation. These applications will be tracked by add remove programs in the fashion native to their installations. Separate "scriptlets" were created to facilitate each of the 3 installations. While they are effective at installing the requisite software they can be discarded if a better system is available.

The main goal of this project is to distribute the primary binary and the secondary goal is to automate the detection of the 3 requisite applications and install them, if necessary.

I have already written a script that handles this entire process but the allure of PowerShell Studio with MSI features added a layer of professionalism to the finished product I found desirable.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Mon Apr 15, 2024 3:28 pm
Answers: 20
Been upvoted: 37 times

Re: Please Expand on MSI Prerequisite thread

Post by Alexander Riedel »

Seems straight forward. From what I read you have all the pieces in place, you just need to launch the script you mention as a custom action on installation.
Read the blog article I mentioned about PrimalScript and custom actions and give it a week or two for the next build of PowerShell Studio to make it through
QA.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PXL_Posh
Posts: 40
Last visit: Thu Nov 07, 2019 5:43 am

Re: Please Expand on MSI Prerequisite thread

Post by PXL_Posh »

Alright, thank you for your response.
This topic is 6 years and 1 week 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.