diff options
Diffstat (limited to 'buildscripts/msitrim.py')
-rw-r--r-- | buildscripts/msitrim.py | 95 |
1 files changed, 52 insertions, 43 deletions
diff --git a/buildscripts/msitrim.py b/buildscripts/msitrim.py index 45ca8d482ac..52736d8e869 100644 --- a/buildscripts/msitrim.py +++ b/buildscripts/msitrim.py @@ -1,43 +1,52 @@ -"""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);
+"""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) |