summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-11-12 02:57:58 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-11-12 02:57:58 +0100
commit922d85d1f89190537bc2c73fa22117d516ad1ba8 (patch)
tree3fd0488f1922b8329d8df4777a55d8c01b10fdb2 /tools
parentf5b7ac49999b1d843176eedb3dc880e8977a5d64 (diff)
downloadmsitools-922d85d1f89190537bc2c73fa22117d516ad1ba8.tar.gz
msitools-922d85d1f89190537bc2c73fa22117d516ad1ba8.tar.xz
msitools-922d85d1f89190537bc2c73fa22117d516ad1ba8.zip
wixl: make component id generation more unique
Use a complete path for genenerating unique component id
Diffstat (limited to 'tools')
-rw-r--r--tools/wixl/builder.vala7
-rw-r--r--tools/wixl/wix.vala13
2 files changed, 13 insertions, 7 deletions
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 22233fe..9a6e738 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -675,12 +675,7 @@ namespace Wixl {
file.DiskId = file.DiskId ?? "1";
return_if_fail (file.DiskId == "1");
- var name = file.Id;
- if (file.Name != null)
- name = file.Name;
- else if (file.Source != null)
- name = Path.get_basename (file.Source);
-
+ var name = file.path_name ();
var source = file.Source ?? name;
var comp = file.parent as WixComponent;
FileInfo info;
diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala
index 5e290fb..6ccccf1 100644
--- a/tools/wixl/wix.vala
+++ b/tools/wixl/wix.vala
@@ -419,7 +419,7 @@ namespace Wixl {
public File file;
public override string path_name () throws GLib.Error {
- return Name;
+ return Name ?? Path.get_basename (Source);
}
public override void accept (WixNodeVisitor visitor) throws GLib.Error {
@@ -1093,6 +1093,17 @@ namespace Wixl {
base.accept (visitor);
visitor.visit_directory (this);
}
+
+ public string path_name () {
+ return Name ?? Id;
+ }
+
+ public override string full_path (WixResolver r) throws GLib.Error {
+ if (parent != null && (parent is WixDirectory || parent is WixDirectoryRef))
+ return parent.full_path (r) + "/" + path_name ();
+ else
+ return path_name ();
+ }
}
public class WixElementRef<G>: WixElement {