summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2020-06-25 10:06:23 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-25 17:46:40 +0000
commit22205e28934435803b1e48edae98e3ffab20d09a (patch)
treea5c94c34ab83c6e8561533b4c1368c289f2ccab6
parent5fd5cb9804ac75e5d448b789a3c81a1e167980f3 (diff)
downloadmongo-22205e28934435803b1e48edae98e3ffab20d09a.tar.gz
Revert "SERVER-47257 Ensure back button on final MSI panel works correctly"
This reverts commit a402944f3813927c1145163c36abe0e3c4a50dfa.
-rw-r--r--buildscripts/msitrim.py64
-rw-r--r--src/mongo/installer/msi/SConscript27
-rw-r--r--src/mongo/installer/msi/wxs/UIFragment.wxs41
3 files changed, 83 insertions, 49 deletions
diff --git a/buildscripts/msitrim.py b/buildscripts/msitrim.py
new file mode 100644
index 00000000000..8e06fd0e395
--- /dev/null
+++ b/buildscripts/msitrim.py
@@ -0,0 +1,64 @@
+"""Script to fix up our MSI files."""
+
+import argparse
+import shutil
+
+import msilib
+
+
+def exec_delete(db, query):
+ """Execute delete on db."""
+ view = db.OpenView(query)
+ view.Execute(None)
+
+ cur_record = view.Fetch()
+ view.Modify(msilib.MSIMODIFY_DELETE, cur_record)
+ view.Close()
+
+
+def exec_update(db, query, column, value):
+ """Execute update on db."""
+ 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()
+
+
+def main():
+ """Execute Main program."""
+ 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()
+ print("Trimming MSI")
+
+ db = msilib.OpenDatabase(args.file.name, msilib.MSIDBOPEN_DIRECT)
+
+ exec_delete(
+ db,
+ "select * from ControlEvent WHERE Dialog_ = 'LicenseAgreementDlg' AND Control_ = 'Next' AND Event = 'NewDialog' AND Argument = 'CustomizeDlg'"
+ )
+ exec_delete(
+ db,
+ "select * from ControlEvent WHERE Dialog_ = 'CustomizeDlg' AND Control_ = 'Back' AND Event = 'NewDialog' AND Argument = 'LicenseAgreementDlg'"
+ )
+ exec_delete(
+ db,
+ "select * from ControlEvent WHERE Dialog_ = 'CustomizeDlg' AND Control_ = 'Next' AND Event = 'NewDialog' AND Argument = 'VerifyReadyDlg'"
+ )
+ exec_delete(
+ db,
+ "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)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/src/mongo/installer/msi/SConscript b/src/mongo/installer/msi/SConscript
index b23deba2240..7b54a8137ba 100644
--- a/src/mongo/installer/msi/SConscript
+++ b/src/mongo/installer/msi/SConscript
@@ -146,7 +146,7 @@ env.Command(objects,
' $SOURCES')
#light: link .objs into an msi
-msi = "$BUILD_DIR/msi/${SERVER_DIST_BASENAME}.msi"
+pre_msi = "$BUILD_DIR/msi/${SERVER_DIST_BASENAME}.pre.msi"
# Suppress VC140_CRT_CRT.MSM Internal Consistency Errors
# ICE03 - Supress "String overflow"
@@ -158,30 +158,33 @@ msi = "$BUILD_DIR/msi/${SERVER_DIST_BASENAME}.msi"
# so this consistency check can be ignored.
# -- https://msdn.microsoft.com/en-us/library/windows/desktop/aa368954(v=vs.85).aspx
-msi_cmd = env.Command(msi,
+pre_msi_cmd = env.Command(pre_msi,
objects,
'"$WIXLIGHT" -out ${TARGET} -wx -cultures:null -sice:ICE82 -sice:ICE03 -sice:ICE30'
' -ext "$WIXUIEXT"'
' -ext "$WIXUTILEXT"'
' ${SOURCES}')
-env.NoCache(msi_cmd)
+env.NoCache(pre_msi_cmd)
# Generated Dependencies
-env.Depends(msi_cmd, '$BUILD_DIR/mongo/mongo.exe')
-env.Depends(msi_cmd, '$BUILD_DIR/mongo/mongod.exe')
-env.Depends(msi_cmd, '$BUILD_DIR/mongo/mongos.exe')
-env.Depends(msi_cmd, '$BUILD_DIR/mongo/installer/msi/ca/mongoca.dll')
-env.Depends(msi_cmd, '$BUILD_DIR/mongo/installer/compass/Install-Compass.ps1')
+env.Depends(pre_msi_cmd, '$BUILD_DIR/mongo/mongo.exe')
+env.Depends(pre_msi_cmd, '$BUILD_DIR/mongo/mongod.exe')
+env.Depends(pre_msi_cmd, '$BUILD_DIR/mongo/mongos.exe')
+env.Depends(pre_msi_cmd, '$BUILD_DIR/mongo/installer/msi/ca/mongoca.dll')
+env.Depends(pre_msi_cmd, '$BUILD_DIR/mongo/installer/compass/Install-Compass.ps1')
# Source Dependencies
-env.Depends(msi_cmd, '#buildscripts/packaging/msi/mongod.yaml')
+env.Depends(pre_msi_cmd, '#buildscripts/packaging/msi/mongod.yaml')
if 'enterprise' in env['MONGO_MODULES']:
- env.Depends(msi_cmd, "#" + enterpriseToolBuildDir + "/mongodecrypt.exe")
- env.Depends(msi_cmd, "#" + enterpriseToolBuildDir + "/mongoldap.exe")
- env.Depends(msi_cmd, "#" + enterpriseToolBuildDir + "/mongocryptd.exe")
+ env.Depends(pre_msi_cmd, "#" + enterpriseToolBuildDir + "/mongodecrypt.exe")
+ env.Depends(pre_msi_cmd, "#" + enterpriseToolBuildDir + "/mongoldap.exe")
+ env.Depends(pre_msi_cmd, "#" + enterpriseToolBuildDir + "/mongocryptd.exe")
msi = "$BUILD_DIR/msi/${SERVER_DIST_BASENAME}.msi"
+env.Command(msi,
+ pre_msi,
+ r'$PYTHON buildscripts\msitrim.py ${SOURCES} ${TARGET}')
env.AlwaysBuild(msi)
env.NoCache(msi)
diff --git a/src/mongo/installer/msi/wxs/UIFragment.wxs b/src/mongo/installer/msi/wxs/UIFragment.wxs
index 8c61a2f37ec..6775c80cb78 100644
--- a/src/mongo/installer/msi/wxs/UIFragment.wxs
+++ b/src/mongo/installer/msi/wxs/UIFragment.wxs
@@ -2,44 +2,11 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<UI Id="MongoWixUI">
- <!-- Copy of relevant parts from WixUI_FeatureTree (https://github.com/wixtoolset/wix3/blob/develop/src/ext/UIExtension/wixlib/WixUI_FeatureTree.wxs), with our custom dialog boxes -->
- <UIRef Id="WixUI_Common" />
- <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
- <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
- <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
+ <!-- Base our MSI on the FeatureTree based Wix set, and add our custom dialog boxes -->
+ <UIRef Id="WixUI_FeatureTree" />
- <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
- <Property Id="WixUI_Mode" Value="FeatureTree" />
-
- <DialogRef Id="ErrorDlg" />
- <DialogRef Id="FatalError" />
- <DialogRef Id="FilesInUse" />
- <DialogRef Id="MsiRMFilesInUse" />
- <DialogRef Id="PrepareDlg" />
- <DialogRef Id="ProgressDlg" />
- <DialogRef Id="ResumeDlg" />
- <DialogRef Id="UserExit" />
-
- <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
-
- <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
- <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
-
- <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
- <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="MongoSetupTypeDlg">LicenseAccepted = "1"</Publish>
-
- <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CompassDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
- <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
- <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
-
- <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
-
- <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
- <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
- <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
- <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
-
- <Publish Event="NewDialog" Value="MongoSetupTypeDlg" Dialog="CustomizeDlg" Control="Back">WixUI_InstallMode = "InstallCustom"</Publish>
+ <Publish Event="NewDialog" Value="MongoSetupTypeDlg" Dialog="LicenseAgreementDlg" Control="Next">LicenseAccepted = "1"</Publish>
+ <Publish Event="NewDialog" Value="MongoSetupTypeDlg" Dialog="CustomizeDlg" Control="Back">WixUI_InstallMode = "InstallCustom"</Publish>
<Publish Event="NewDialog" Value="ServiceDlg" Dialog="CustomizeDlg" Control="Next">
<![CDATA[&Server = 3]]>
</Publish>