-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
W0W6432Node / COM Registration #621
Comments
Yeah, when it comes to registry and x64 MSI is a mess. I just tested your use-case with this code: var project =
new Project("MyProduct",
new Dir(@"%ProgramFiles%\My Company\My Product",
new File("readme.txt")),
new RegValue(RegistryHive.LocalMachine, @"Software\My Company\My Product", "LICENSE_KEY_64", "01020304")
{
Win64 = true
});
project.Platform = Platform.x64;
project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
project.UI = WUI.WixUI_ProgressOnly;
project.PreserveTempFiles = true;
project.BuildMsi(); |
My issues was writing to CLASSES_ROOT, in all cases HKLM worked as expected.
I did find a workaround. I overrode “WixSourceGenerated” and then inserted the elements into the “File” node for the com component. And it worked as expected.
So something like;
```c#
var comElement = document
.Descendants().Where(n => n.Name.LocalName == "File")
.Where(e => e.Attribute("Source").Value == comEntry.Dll)
.FirstOrDefault();
if (comElement != null)
{
comElement.AddElement("Class")
.AddAttributes(new XAttribute[]
{
new XAttribute("Id", “my class id”),
new XAttribute("Context", "InprocServer32"),
new XAttribute("ThreadingModel", “apartment”),
new XAttribute("Description", “descirption)
})
.AddElement("ProgId")
.AddAttributes(new XAttribute[]
{
new XAttribute("Id", “prod.id”),
new XAttribute("Description", "some description")
})
.AddElement("ProgId")
.AddAttributes(new XAttribute[]
{
new XAttribute("Id", “version.i.progid”),
new XAttribute("Description", "Some version")
});
}
```
And it generated the following script;
```xml
<Component Id="Component.RSAPCP.dll" XXXXXXX">
<File Id="RSAPCP.dll" Source="XXX.dll">
<Class Id="CLASS_ID" Context="InprocServer32" ThreadingModel="apartment" Description="MY DESCRIPTION>
<ProgId Id="PROG.ID.1" Description="some description">
<ProgId Id="prog.id" Description="Version independent ProgID " />
</ProgId>
</Class>
</File>
</Component>
```
Will a future version inclide the “Class” and “Prog” id types to be added to a “File” element?
Thanks
Mark
|
Hi Mark,
Yes, absolutely. This is exactly how I want to see WixSharp growing in features... It simply cannot cover the all spectrum of all MSI/WiX features that are inconsistent, unpredictable and often being re-implemented (improved) or even deprecated. I always wanted WixSharp cover let's say 80% of all WiX functionality (~99% of most common use-cases). Thus in case of WixSharp running out of steam users can use XML injection or Thank you. Will implement it in a few days or so and release a HotFix. |
You don't have to wait until the feature is avilable in the next release. You can just repeat it in your codebase by defining the Your msi project definition: new File(@"Files\Bin\MyApp.exe",
new ComRegistration
{
Id = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"),
Description = "MY DESCRIPTION",
ThreadingModel = "apartment",
Context = "InprocServer32",
ProgIds = new[]
{
new ProgId
{
Id = "PROG.ID.1",
Description ="Version independent ProgID ",
ProgIds = new[]
{
new ProgId
{
Id = "prog.id",
Description="some description"
}
}
}
}
},
. . . And the public class ProgId
{
[WixSharp.Xml]
public string Id;
[WixSharp.Xml]
public bool? Advertise;
[WixSharp.Xml]
public string Description;
[WixSharp.Xml]
public string Icon;
[WixSharp.Xml]
public string IconIndex;
[WixSharp.Xml]
public string NoOpen;
public ProgId[] ProgIds;
public XElement ToXElement()
{
var root = new XElement("ProgId");
root.Add(this.MapToXmlAttributes());
ProgIds?.ForEach(progIdChild => root.Add(progIdChild.ToXElement()));
return root;
}
}
public class ComRegistration : WixEntity, IGenericEntity
{
[WixSharp.Xml]
public new Guid Id;
[WixSharp.Xml]
public bool? Advertise;
[WixSharp.Xml]
public string Context = "InprocServer32";
[WixSharp.Xml]
public string ThreadingModel;
[WixSharp.Xml]
public string Description;
public ProgId[] ProgIds;
public void Process(ProcessingContext context)
{
XElement element = this.ToXElement("Class");
ProgIds?.ForEach(progIdChild => element.Add(progIdChild.ToXElement()));
context.XParent.Add(element);
}
} |
I tested it out and it worked like a charm!
Unfortunately, for my solution the my original solution worked out better for how my application was structured.
Thanks again for your great work; I will be using your solution for a larger project that I am starting later this spring.
Mark
|
I have 100% 64 bit application. As part of the installation script I am registering a single COM object by writing the values directly to HKCR\CLSID{XXXXXX}...
The problem is that on installation the values are being writen to the WIN6432 node.
The projects platform is set to X64 and all of the component nodes are set to Win64-"yes"
Here is a snippet of the generated script. Any ideas on what to look for in the MSI spew log? From what I can tell it is trying to write to the 64 bit CLSID.
Thanks!
The text was updated successfully, but these errors were encountered: