Skip to content

Commit de2330b

Browse files
authored
added main script
1 parent b610609 commit de2330b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

MSI-extractor.ps1

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Add-Type -AssemblyName System.Windows.Forms
2+
3+
#Use Windows Forms to open a file select dialog
4+
5+
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
6+
InitialDirectory = [Environment]::GetFolderPath('Desktop')
7+
Filter = 'Windows Packages (*.msi)|*.msi'
8+
}
9+
10+
$Out = $FileBrowser.ShowDialog() #Display the dialog
11+
12+
#Select output directory
13+
14+
$FolderBrowser = New-Object System.Windows.Forms.FolderBrowserDialog -Property @{
15+
Description = 'Output'
16+
}
17+
18+
$Out = $FolderBrowser.ShowDialog() #Display the dialog
19+
20+
$FolderBrowser.SelectedPath #Variable stuff
21+
22+
msiexec /a $FileBrowser.FileName /qb TARGETDIR=$($FolderBrowser.SelectedPath) # This uses the built in Windows tool to extract the MSI
23+
24+
#A helpful message
25+
26+
$Shell = New-Object -ComObject "WScript.Shell"
27+
$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.
28+
To add a program to path, search for Control Panel in Windows Search, and open it. Once in Control Panel,
29+
select User Accounts, then User Accounts again. On the side bar, select Change my Enviorment Variables.
30+
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.
31+
You WILL need to restart any open shells.", 0, "Thank you for using MSI-Extractor", 0)

0 commit comments

Comments
 (0)