summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-07-11 18:18:45 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-07-11 18:26:24 +0200
commit12f5b505af3a28ec59f1e253544502367564afe8 (patch)
tree7bc47bc8f3ca6335e80be6e6a0f665aca373104a /tools
parent3d838b3c20ba8bdd18681452bc681d970d5777cd (diff)
downloadmsitools-12f5b505af3a28ec59f1e253544502367564afe8.zip
msitools-12f5b505af3a28ec59f1e253544502367564afe8.tar.gz
msitools-12f5b505af3a28ec59f1e253544502367564afe8.tar.xz
wixl: Start basic MajorUpgrade element
Diffstat (limited to 'tools')
-rw-r--r--tools/wixl/builder.vala31
-rw-r--r--tools/wixl/wix.vala14
2 files changed, 43 insertions, 2 deletions
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 0ed8abc..65c97bd 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -144,8 +144,10 @@ namespace Wixl {
add (MSIDefault.Action.PublishFeatures);
add (MSIDefault.Action.PublishProduct);
add (MSIDefault.Action.InstallFinalize);
- if (db.table_upgrade.records.length () > 0)
+ if (db.table_upgrade.records.length () > 0) {
add (MSIDefault.Action.FindRelatedProducts);
+ add (MSIDefault.Action.MigrateFeatureStates);
+ }
if (db.table_launch_condition.records.length () > 0)
add (MSIDefault.Action.LaunchConditions);
if (db.table_registry.records.length () > 0) {
@@ -178,8 +180,10 @@ namespace Wixl {
add (MSIDefault.Action.FileCost);
add (MSIDefault.Action.CostFinalize);
add (MSIDefault.Action.ExecuteAction);
- if (db.table_upgrade.records.length () > 0)
+ if (db.table_upgrade.records.length () > 0) {
add (MSIDefault.Action.FindRelatedProducts);
+ add (MSIDefault.Action.MigrateFeatureStates);
+ }
if (db.table_launch_condition.records.length () > 0)
add (MSIDefault.Action.LaunchConditions);
table.add_sorted_actions ();
@@ -1054,6 +1058,29 @@ namespace Wixl {
binary.file = find_file (binary.SourceFile, out info);
db.table_binary.add (binary.Id, binary.file.get_path ());
}
+
+ public override void visit_major_upgrade (WixMajorUpgrade major) throws GLib.Error {
+ var product = major.parent as WixProduct;
+
+ var property = "WIX_DOWNGRADE_DETECTED";
+ db.table_upgrade.add (get_uuid (product.UpgradeCode), product.Version, "", 2, property);
+
+ secureProperties += property;
+
+ property = "WIX_UPGRADE_DETECTED";
+ db.table_upgrade.add (get_uuid (product.UpgradeCode), "", product.Version, 1, property);
+ secureProperties += property;
+
+ if (major.DowngradeErrorMessage != null) {
+ db.table_launch_condition.add ("NOT WIX_DOWNGRADE_DETECTED", major.DowngradeErrorMessage);
+ }
+
+ var table = db.table_install_execute_sequence;
+ var node = table.get_action ("RemoveExistingProducts");
+ warn_if_fail (node.action == null);
+ node.add_dep (table.get_action ("InstallValidate"));
+ }
+
}
} // Wixl
diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala
index 1419090..93ff935 100644
--- a/tools/wixl/wix.vala
+++ b/tools/wixl/wix.vala
@@ -64,6 +64,7 @@ namespace Wixl {
public abstract void visit_registry_search (WixRegistrySearch search) throws GLib.Error;
public abstract void visit_custom_action (WixCustomAction action) throws GLib.Error;
public abstract void visit_binary (WixBinary binary) throws GLib.Error;
+ public abstract void visit_major_upgrade (WixMajorUpgrade major) throws GLib.Error;
}
public abstract class WixNode: Object {
@@ -937,6 +938,18 @@ namespace Wixl {
}
}
+ public class WixMajorUpgrade: WixElement {
+ static construct {
+ name = "MajorUpgrade";
+ }
+
+ public string DowngradeErrorMessage { get; set; }
+
+ public override void accept (WixNodeVisitor visitor) throws GLib.Error {
+ visitor.visit_major_upgrade (this);
+ }
+ }
+
public class WixProduct: WixElement {
static construct {
name = "Product";
@@ -958,6 +971,7 @@ namespace Wixl {
typeof (WixUpgrade),
typeof (WixCustomAction),
typeof (WixBinary),
+ typeof (WixMajorUpgrade),
});
}