Skip to content

Commit

Permalink
Robustify msi creator script.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Feb 24, 2018
1 parent 221c3ec commit e2a4cff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions msi/createmsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ def __init__(self):
self.staging_dirs = ['dist', 'dist2']
if self.bytesize == 64:
self.progfile_dir = 'ProgramFiles64Folder'
self.redist_path = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Redist\\MSVC\\14.11.25325\\MergeModules\\Microsoft_VC141_CRT_x64.msm'
redist_glob = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Redist\\MSVC\\*\\MergeModules\\Microsoft_VC141_CRT_x64.msm'
else:
self.progfile_dir = 'ProgramFilesFolder'
self.redist_path = 'C:\\Program Files\\Microsoft Visual Studio\\2017\\Community\\VC\\Redist\\MSVC\\14.11.25325\\MergeModules\\Microsoft_VC141_CRT_x86.msm'
redist_glob = 'C:\\Program Files\\Microsoft Visual Studio\\2017\\Community\\VC\\Redist\\MSVC\\*\\MergeModules\\Microsoft_VC141_CRT_x86.msm'
trials = glob(redist_glob)
if len(trials) != 1:
sys.exit('There are more than one potential redist dirs.')
self.redist_path = trials[0]
self.component_num = 0
self.feature_properties = {
self.staging_dirs[0]: {
Expand Down Expand Up @@ -253,6 +257,7 @@ def build_package(self):
if __name__ == '__main__':
if not os.path.exists('meson.py'):
sys.exit(print('Run me in the top level source dir.'))
subprocess.check_call(['pip', 'install', '--upgrade', 'cx_freeze'])

p = PackageGenerator()
p.build_dist()
Expand Down

0 comments on commit e2a4cff

Please sign in to comment.