MSI Creator Documentation

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 month 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
tkleen
Posts: 5
Last visit: Tue Oct 02, 2018 10:43 am

MSI Creator Documentation

Post by tkleen »

Product, version and build: PowerShell Studio 2017 v5.4.145
32 or 64 bit version of product: 64
Operating system: W10 Ent 1703
32 or 64 bit OS: 64

Hello,

Where can I find documentation on the MSI creator functionality in Powershell Studio? I'm not finding it, outside of the very sparse documentation in the product manual.

Thank you.
cody m

Re: MSI Creator Documentation

Post by cody m »

Here is a Blog post about the MSI Wizard
https://www.sapien.com/blog/2013/06/05/ ... si-wizard/

Were you looking for any information in particular or just curious about MSI Packager?
User avatar
tkleen
Posts: 5
Last visit: Tue Oct 02, 2018 10:43 am

Re: MSI Creator Documentation

Post by tkleen »

Hi.

I've read that, and it isn't really answering my question. I'm trying to convert the following script into an msi. I've created a 64 bit and 32 bit msi installer and packaged the relevent exe with the msi. Neither will install, but the script installs fine. Running msiexec with the /l*v flag does not give any good info on why it's failing. My guess is it's probably some variable I'm using in the script that's not compatible. Script below:

function main
{
try
{
if (get-service | Where-Object { $_.name -eq "GRR Monitor" }) { Remove-GRR }
if ($env:PROCESSOR_ARCHITECTURE -eq 'AMD64')
{
Start-Process "$sd\GRR_3.2.1.1_amd64.exe"
}
else
{
Start-Process "$sd\grr_3.2.1.1_i386.exe"
}
exit 0
}
catch
{
$_ >> $env:windir\Temp\Install.GRR.3.2.1.1.x86.x64.ps1.log
exit 1
}
}



function Remove-GRR
{
$GRRService = get-service | Where-Object { $_.name -eq "GRR Monitor" }
$GRRService | ForEach-Object {
$c = $_
$c | Stop-Service
$service = Get-WmiObject -Class Win32_Service -Filter "Name='$($c.name)'"
$service.delete() | Out-Null
}
if (Test-Path "$env:windir\System32\GRR") { rm -r "$env:windir\System32\GRR" -Force | Out-Null }
if (Test-Path "$env:windir\System32\grr_installer.txt") { rm "$env:windir\System32\grr_installer.txt" -Force | Out-Null }
if (Test-Path "hklm:\SOFTWARE\GRR") { rm -r "hklm:\SOFTWARE\GRR" -Force | Out-Null }
}



function Get-ScriptDirectory
{
<#
.SYNOPSIS
Get-ScriptDirectory returns the proper location of the script.

.OUTPUTS
System.String

.NOTES
Returns the correct path within a packaged executable.
#>
[OutputType([string])]
param ()
if ($null -ne $hostinvocation)
{
Split-Path $hostinvocation.MyCommand.path
}
else
{
Split-Path $script:MyInvocation.MyCommand.Path
}
}



#####SCRIPT ENTRY POINT#####
$sd = Get-ScriptDirectory
main
############################
cody m

Re: MSI Creator Documentation

Post by cody m »

I created and MSI and installed this script without any errors that I can see so far, could you possibly send a screen shot of your Packager and MSI settings? Also are you building separate 32 and 64 bit exes?
User avatar
tkleen
Posts: 5
Last visit: Tue Oct 02, 2018 10:43 am

Re: MSI Creator Documentation

Post by tkleen »

It creates an msi and the msi will run, but it doesn't seem to execute the script. The msi shows up in the Add/Remove Programs menu as an installed application.
Attachments
MSI.Settings.2.PNG
MSI.Settings.2.PNG (25.6 KiB) Viewed 4584 times
MSI.Settings.1.PNG
MSI.Settings.1.PNG (23.63 KiB) Viewed 4584 times
User avatar
tkleen
Posts: 5
Last visit: Tue Oct 02, 2018 10:43 am

Re: MSI Creator Documentation

Post by tkleen »

I've looked through the log files for the msi a little closer this morning. It looks like this is copying the files to the Program Files folder of the local computer, but it isn't executing the script. Is this by design?

Thanks.
cody m

Re: MSI Creator Documentation

Post by cody m »

Under your Files/Folder setting you have the the packager creating a shortcut to the script file. It needs to create a shortcut to the executable. since the default action of double clicking a ps1 file is to edit that file not run that file.
User avatar
tkleen
Posts: 5
Last visit: Tue Oct 02, 2018 10:43 am

Re: MSI Creator Documentation

Post by tkleen »

How do I configure it to run the powershell script? Do I need to create a bat file with the powershell command and create a shortcut to that in the msi creator?

Thank you for your help.
cody m

Re: MSI Creator Documentation

Post by cody m »

Here are two more articles about the MSI Packager and its settings.
https://www.sapien.com/blog/2014/03/25/ ... 14-part-1/
https://www.sapien.com/blog/2014/04/07/ ... 14-part-2/

These Articles should help explain how to set where the shortcuts go.
This topic is 6 years and 1 month 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.