Skip to content

Commit

Permalink
(wix) improve productID autogeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
sblaisot committed Aug 10, 2017
1 parent 822675b commit 045622f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ build/wix/subdirs/*.wxs
# The following 2 files are autogenerated by scons at release time
# based on .tmpl template file for the second one.
build/wix/bundle/bundleloc.wxs
build/wix/mixxx.wxs
build/wix/ProductID.wxi

*.obj
*.pdb
Expand Down
4 changes: 4 additions & 0 deletions build/wix/ProductID.wxi.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Include>
<?define ProductID=@PRODUCT_ID@ ?>
</Include>
34 changes: 22 additions & 12 deletions build/wix/mixxx.wxs.tmpl → build/wix/mixxx.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
http://stackoverflow.com/questions/15305718/removing-unwanted-nodes-from-wxs-file-by-applying-xslt-tranfsormation/15306740#15306740
-->

<!--
====================================================================================
Includes
-->

<?include ProductID.wxi ?>

<!--
====================================================================================
Defines & Variables
Expand Down Expand Up @@ -54,7 +61,7 @@

<!-- The upgrade code must never change as long as the product lives! -->
<!-- Product IDs must be autogenerated (*) or else major upgrades will not work -->
<Product Id="==SCONS-GENERATED-PRODUCTID=="
<Product Id="$(var.ProductID)"
Name="!(loc.ApplicationName)"
Language="!(loc.Language)"
Version="$(var.VersionNumber)"
Expand Down Expand Up @@ -105,7 +112,7 @@
Type="raw"
Win64="yes" />
<?endif?>
</Property>
</Property>

<!-- This will search if mixxx is already installed in another bitWidth -->
<Property Id="OTHERBITWIDTHINSTALLED">
Expand Down Expand Up @@ -377,6 +384,7 @@
<ComponentGroupRef Id='keyboardComp' />
<ComponentGroupRef Id='controllersComp' />
<ComponentGroupRef Id='skinsComp' />

<?if $(var.PDB) = "yes" ?>
<Feature Id="PDBFeature"
Title="!(loc.FeaturePDBTitle)"
Expand All @@ -387,6 +395,7 @@
<ComponentGroupRef Id='mainPDBCompGroup' />
</Feature>
<?endif?>

<Feature Id="DesktopShortcutFeature"
Title="!(loc.FeatureDesktopShortcutTitle)"
Description="!(loc.FeatureDesktopShortcutDescription)"
Expand All @@ -395,6 +404,7 @@
Level="3">
<ComponentRef Id="DesktopShortcutComp" />
</Feature>

</Feature>

<!-- A feature block for translations -->
Expand Down Expand Up @@ -423,20 +433,20 @@
<WixVariable Id="WixUIBannerBmp" Value="images\banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="images\dialog.bmp" />

<UI Id="MyWixUI_FeatureTree">
<UIRef Id="WixUI_FeatureTree" />
<UIRef Id="WixUI_ErrorProgressText" />
<UI Id="MyWixUI_FeatureTree">
<UIRef Id="WixUI_FeatureTree" />
<UIRef Id="WixUI_ErrorProgressText" />

<DialogRef Id="WarningDlg" />
<DialogRef Id="WarningDlg" />

<Publish Dialog="WarningDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="WarningDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="WarningDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="WarningDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>

<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="WarningDlg"><![CDATA[( NOT MyWarningText1 = " " ) OR ( NOT MyWarningText2 = " ") OR ( NOT MyWarningText3 = " ")]]></Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg"><![CDATA[( MyWarningText1 = " " ) AND ( MyWarningText2 = " " ) AND ( MyWarningText3 = " " )]]></Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="WarningDlg"><![CDATA[( NOT MyWarningText1 = " " ) OR ( NOT MyWarningText2 = " ") OR ( NOT MyWarningText3 = " ")]]></Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg"><![CDATA[( MyWarningText1 = " " ) AND ( MyWarningText2 = " " ) AND ( MyWarningText3 = " " )]]></Publish>

<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WarningDlg"><![CDATA[( NOT MyWarningText1 = " " ) OR ( NOT MyWarningText2 = " ") OR ( NOT MyWarningText3 = " ")]]></Publish>
</UI>
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WarningDlg"><![CDATA[( NOT MyWarningText1 = " " ) OR ( NOT MyWarningText2 = " ") OR ( NOT MyWarningText3 = " ")]]></Publish>
</UI>

</Product>
</Wix>
9 changes: 5 additions & 4 deletions src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,12 @@ def BuildRelease(target, source, env):
# Generating random ProductID (should change on every run)
# and put it in mixxx.wxs using the template
ProductID = str(uuid.uuid1()).upper()
with open("build/wix/mixxx.wxs.tmpl", "rt") as fin:
with open("build/wix/mixxx.wxs", "wt") as fout:
with open("build/wix/ProductID.wxi.in", "rt") as fin:
with open("build/wix/ProductID.wxi", "wt") as fout:
for line in fin:
fout.write(line.replace('==SCONS-GENERATED-PRODUCTID==', ProductID))
fout.write(line.replace('@PRODUCT_ID@', ProductID))
fin.close()
fout.close()

# The default language
defaultLanguage="en-us"
Expand Down Expand Up @@ -916,7 +918,6 @@ def BuildRelease(target, source, env):
os.remove(file)
for file in glob.glob('build\wix\subdirs\*.wxs'):
os.remove(file)
os.remove("build/wix/mixxx.wxs")
os.remove(exe_name)

else:
Expand Down

0 comments on commit 045622f

Please sign in to comment.