Skip to content

Commit

Permalink
added main script
Browse files Browse the repository at this point in the history
  • Loading branch information
kernaltrap8 authored Nov 19, 2022
1 parent b610609 commit de2330b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions MSI-extractor.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Add-Type -AssemblyName System.Windows.Forms

#Use Windows Forms to open a file select dialog

$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
InitialDirectory = [Environment]::GetFolderPath('Desktop')
Filter = 'Windows Packages (*.msi)|*.msi'
}

$Out = $FileBrowser.ShowDialog() #Display the dialog

#Select output directory

$FolderBrowser = New-Object System.Windows.Forms.FolderBrowserDialog -Property @{
Description = 'Output'
}

$Out = $FolderBrowser.ShowDialog() #Display the dialog

$FolderBrowser.SelectedPath #Variable stuff

msiexec /a $FileBrowser.FileName /qb TARGETDIR=$($FolderBrowser.SelectedPath) # This uses the built in Windows tool to extract the MSI

#A helpful message

$Shell = New-Object -ComObject "WScript.Shell"
$Button = $Shell.Popup("Once you install the MSI using this PowerShell script, please add any programs that run from a shell (i.e. CMD, PowerShell) be added to Path.
To add a program to path, search for Control Panel in Windows Search, and open it. Once in Control Panel,
select User Accounts, then User Accounts again. On the side bar, select Change my Enviorment Variables.
Select the Path variable, and then Edit. Select a unfilled box, and type the path to the program (for most, it can be just the root folder, some may need to be bin) and then Ok, and Ok again.
You WILL need to restart any open shells.", 0, "Thank you for using MSI-Extractor", 0)

0 comments on commit de2330b

Please sign in to comment.