-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b610609
commit de2330b
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |