Comments (4)
Sorry I somehow missed your post.
Have a look at InjectXML sample. It demonstrates how to extend Wix# with a new element by implementing IGenericEntity
.
Note, currently, Wix# allows generic Entities to be added to directories only. I am marking this post as enhancement
and will make the change for the next release to allow generic Entities to be added to files as well. But for now you will need to find the file element in your Process
method:
You will need something similar to thie:
var project =
new Project("MyProduct",
new Dir(@"%ProgramFiles64Folder%\My Company\My Product",
new NativeImage { Platform = "32bit" },
new File(@"Files\Bin\MyApp.exe"),
...
public class NativeImage : WixEntity, IGenericEntity
{
[WixSharp.Xml]
new public string Id
{
get { return base.Id; }
set { Id = value; }
}
[WixSharp.Xml]
public string Platform;
[WixSharp.Xml]
public int Priority = 0;
[WixSharp.Xml]
public string AppBaseDirectory;
....
public void Process(ProcessingContext context)
{
var util = WixExtension.NetFx;
context.Project.IncludeWixExtension(util);
//serialize itself and add to the parent component
context.XParent
.FindAll("File")
.First(e => e.HasAttribute("Source", value=>value.EndsWith("MyApp.exe")))
.Add(this.ToXElement(util, "NativeImage"));
}
}
from wixsharp.
Hi Oleg,
No worries.
Thanks for the response & snippet. I'll be assuming this approach by now then.
I'm glad you considered as an enhancement. Thank you again.
from wixsharp.
Done in 61ed80e
Ready and waiting for release.
new Project("MyProduct",
new Dir(@"%ProgramFiles%\MyCompany\MyProduct",
new Files(@"Release\Bin\logger.dll",
new NativeImage { Platform = NativeImagePlatform.x86}),
from wixsharp.
Great News Oleg!
I see you modified the Files
class to allow an IGenericEntity
as child - this will bring great flexibility from now on.
Thanks!
from wixsharp.
Related Issues (20)
- Overview of which SetupEventHandler is fired on which type of project HOT 2
- Wix Woolkit 3.14.1 not working "SFXCA: Failed to create temp directory. Error code 5" HOT 1
- MSI build is failing with failed to add file - Even path is available HOT 7
- How to see in WixSharp project which Wix toolkit version is being used AFTER it has been created? HOT 3
- Restart Office apps after installation HOT 23
- Build issue
- Reg. Value Compare with NSIS BootStrapper HOT 3
- dynamic value for IISWebsite
- Some strings in Dialogs from .wxl are not replaced in Custom WPF UI HOT 6
- Snoop support HOT 3
- Incorrect FirewallException.IcmpTypesAndCodes property type HOT 3
- Using other (not Caliburn.Micro) MVVM framework HOT 1
- Sign Wixsharp dlls HOT 3
- [Question] Is there better way to create BA Installer for user choice ?
- Project GUID in Wix# script gets assigned as upgrade code and project ID is differently generated HOT 3
- Enable signing all user supplied files by default (continuation of #1543)
- Error on adding FirewallException HOT 1
- Hidden child features in FeaturesDialog.UserSelectedItems
- Extracting a zip file during installation HOT 1
- Use LocalSystem for Windows Service. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wixsharp.