-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SERVER-30995 Add Compass Installer to MongoDB packaging
- Loading branch information
1 parent
1265944
commit a9299df
Showing
23 changed files
with
961 additions
and
648 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 |
---|---|---|
@@ -1,43 +1,43 @@ | ||
"""Script to fix up our MSI files """ | ||
|
||
import argparse; | ||
import msilib | ||
import shutil; | ||
|
||
parser = argparse.ArgumentParser(description='Trim MSI.') | ||
parser.add_argument('file', type=argparse.FileType('r'), help='file to trim') | ||
parser.add_argument('out', type=argparse.FileType('w'), help='file to output to') | ||
|
||
args = parser.parse_args() | ||
|
||
def exec_delete(query): | ||
view = db.OpenView(query) | ||
view.Execute(None) | ||
|
||
cur_record = view.Fetch() | ||
view.Modify(msilib.MSIMODIFY_DELETE, cur_record) | ||
view.Close() | ||
|
||
|
||
def exec_update(query, column, value): | ||
view = db.OpenView(query) | ||
view.Execute(None) | ||
|
||
cur_record = view.Fetch() | ||
cur_record.SetString(column, value) | ||
view.Modify(msilib.MSIMODIFY_REPLACE, cur_record) | ||
view.Close() | ||
|
||
|
||
print "Trimming MSI" | ||
|
||
db = msilib.OpenDatabase(args.file.name, msilib.MSIDBOPEN_DIRECT) | ||
|
||
exec_delete("select * from ControlEvent WHERE Dialog_ = 'LicenseAgreementDlg' AND Control_ = 'Next' AND Event = 'NewDialog' AND Argument = 'CustomizeDlg'") | ||
exec_delete("select * from ControlEvent WHERE Dialog_ = 'CustomizeDlg' AND Control_ = 'Back' AND Event = 'NewDialog' AND Argument = 'LicenseAgreementDlg'") | ||
|
||
exec_update("select * from ControlEvent WHERE Dialog_ = 'VerifyReadyDlg' AND Control_ = 'Back' AND Event = 'NewDialog' AND Argument = 'CustomizeDlg'", 5, "WixUI_InstallMode = \"InstallCustom\"") | ||
|
||
db.Commit() | ||
|
||
shutil.copyfile(args.file.name, args.out.name); | ||
"""Script to fix up our MSI files """ | ||
|
||
import argparse; | ||
import msilib | ||
import shutil; | ||
|
||
parser = argparse.ArgumentParser(description='Trim MSI.') | ||
parser.add_argument('file', type=argparse.FileType('r'), help='file to trim') | ||
parser.add_argument('out', type=argparse.FileType('w'), help='file to output to') | ||
|
||
args = parser.parse_args() | ||
|
||
def exec_delete(query): | ||
view = db.OpenView(query) | ||
view.Execute(None) | ||
|
||
cur_record = view.Fetch() | ||
view.Modify(msilib.MSIMODIFY_DELETE, cur_record) | ||
view.Close() | ||
|
||
|
||
def exec_update(query, column, value): | ||
view = db.OpenView(query) | ||
view.Execute(None) | ||
|
||
cur_record = view.Fetch() | ||
cur_record.SetString(column, value) | ||
view.Modify(msilib.MSIMODIFY_REPLACE, cur_record) | ||
view.Close() | ||
|
||
|
||
print "Trimming MSI" | ||
|
||
db = msilib.OpenDatabase(args.file.name, msilib.MSIDBOPEN_DIRECT) | ||
|
||
exec_delete("select * from ControlEvent WHERE Dialog_ = 'LicenseAgreementDlg' AND Control_ = 'Next' AND Event = 'NewDialog' AND Argument = 'CustomizeDlg'") | ||
exec_delete("select * from ControlEvent WHERE Dialog_ = 'CustomizeDlg' AND Control_ = 'Back' AND Event = 'NewDialog' AND Argument = 'LicenseAgreementDlg'") | ||
exec_delete("select * from ControlEvent WHERE Dialog_ = 'CustomizeDlg' AND Control_ = 'Next' AND Event = 'NewDialog' AND Argument = 'VerifyReadyDlg'") | ||
exec_delete("select * from ControlEvent WHERE Dialog_ = 'VerifyReadyDlg' AND Control_ = 'Back' AND Event = 'NewDialog' AND Argument = 'CustomizeDlg'") | ||
|
||
db.Commit() | ||
|
||
shutil.copyfile(args.file.name, args.out.name); |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,43 @@ | ||
#Requires -Version 3.0 | ||
<# | ||
.SYNOPSIS | ||
Download and install latest version of MongoDB Compass. | ||
|
||
.DESCRIPTION | ||
A longer description. | ||
|
||
.INPUTS | ||
Description of objects that can be piped to the script | ||
|
||
.OUTPUTS | ||
Description of objects that are output by the script | ||
|
||
.EXAMPLE | ||
Example of how to run the script | ||
|
||
.LINK | ||
Links to further documentation | ||
|
||
.NOTES | ||
Detail on what the script does, if this is needed | ||
#> | ||
param() | ||
$ErrorActionPreference = 'Stop' | ||
|
||
$CompassUrl = 'https://compass.mongodb.com/api/v2/download/latest/@compass_type@/stable/windows' | ||
|
||
$TemporaryDir = [System.IO.Path]::GetTempPath() | ||
$CompassExe = "$TemporaryDir" + "compass-install.exe" | ||
|
||
Remove-Item $CompassExe -ErrorAction:Ignore | ||
|
||
Write-Output "Downloading Compass from $CompassUrl" | ||
Invoke-WebRequest -Uri $CompassUrl -OutFile $CompassExe | ||
|
||
Write-Output "Installing Compass" | ||
& $CompassExe | ||
|
||
# Remove the binary we downloaded | ||
Remove-Item $CompassExe -ErrorAction:Ignore | ||
|
||
Write-Output "Successfully installed Compass" |
Oops, something went wrong.