Quantcast
Channel: wixsharp Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1354

New Post: How can best I allow edits on a config file for Windows Service App before the installation?

$
0
0
As for your previous post...
>Could the DeferredActions sample be updated to show the best way to get properties from CustomUI dialogs to Tasks.SetConfigAttribute?
Yes. I agree. Done: "https://wixsharp.codeplex.com/SourceControl/latest#src/WixSharp.Samples/Wix# Samples/DeferredActions/setup.cs"

> In either context, ManagedProject Properties need to have IsDeferred true to get copied to the SetupEventArgs Session.Property collection.
I think it's a typo and you mean ManagedAction. There is a dedicated derived class ElevatedManagedAction, which already has IsDeferred=true;

>I haven't found a way yet to access IsFeatureEnabled or ManagedProject Session values. Do I have to copy Session["ADDLOCAL"] to a Property if I want to modify a config file only if a particular feature is being installed? Is there a better way to do it?
"IsFeatureEnabled or ManagedProject Session values" cannot be accessed as MSI destroys them before invoking any deferred action. I provided a detailed description in my previous post in this thread.

The best way to discover the features being installed is to preserve ADDLOCAL and then anayse it in the AfterInstall action. BTW the next release will have ADDLOCAL automatically preserved and you will not need update DefaultDeferredProperties in your project definition.
project.DefaultDeferredProperties += ",ADDLOCAL";
...
staticvoid project_AfterInstall(SetupEventArgs e)
{
   bool isFeatureInstalled = e.Session.Property("ADDLOCAL").Split(',').Contains("<name of the feature>");
Note, ADDLOCAL must be accessed via 'Property' method as otherwise (e.Session[<prop_name>]) the value is not available

Viewing all articles
Browse latest Browse all 1354

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>