Giter Site home page Giter Site logo

Comments (4)

Torchok19081986 avatar Torchok19081986 commented on July 26, 2024

hiho, i had same issue. AFAIK you have to add your public property to MSI in Installer. If you use simple ManagedProject
add it like project.AddProperty(new Property("MODE","Empty")), should work. But for BA Installer you have to add it as well for MsiPackage. Unlikwise, MSI want always all properties denified before, only then you can assign value to it at runtime.

from wixsharp.

Aaswin1996 avatar Aaswin1996 commented on July 26, 2024

hiho, i had same issue. AFAIK you have to add your public property to MSI in Installer. If you use simple ManagedProject add it like project.AddProperty(new Property("MODE","Empty")), should work. But for BA Installer you have to add it as well for MsiPackage. Unlikwise, MSI want always all properties denified before, only then you can assign value to it at runtime.

I am already doing that :
image

from wixsharp.

Aaswin1996 avatar Aaswin1996 commented on July 26, 2024

@oleg-shilo @Torchok19081986 Can someone point me in the right direction ?

from wixsharp.

Torchok19081986 avatar Torchok19081986 commented on July 26, 2024

morning, hm, strange. You can try , just for example, in CA and add it in session["MODE"] = "Whatever". See ouput in beforeinstall event - first option.
second option - Create ManagedAction CA , when.before, check.ignore, Condition.NotInstalled, Step.InstallSequence. Add also MessageBox with session["MODE"] in CA. If messagebox appears with your assign value, something wrong in your Installer.

you can also try add in project defaultdefferedproperties = ",MODE".

following code i used long time ago, for me it works.

new ManagedAction(CustomActions.SetProperty, Return.ignore, When.Before, Step.InstallFinalize, Condition.NOT_Installed)
            {
                UsesProperties = "MYPROPERTY"
            },

custom action should looks following

[CustomAction]
   public static ActionResult SetProperty(Session session)
   {
       // Get the value from the session
       string radioButtonValue = session["MYPROPERTY"];

       // Log the value for debugging purposes
       session.Log("Radio button value: {0}", radioButtonValue);

       // Based on the radio button value, set the property
       if (radioButtonValue == "Whatever1")
       {
           session["MYPROPERTY"] = "Whatever1";
       }
       else if (radioButtonValue == "Whatever2")
       {
           session["MYPROPERTY"] = "Whatever2";
       }
       else
       {
           // Handle unexpected values if necessary
           session["MYPROPERTY"] = "Unknown";
       }

       return ActionResult.Success;
   }

from wixsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.