Frage

I added a "3 Radio Buttons" user interface to the setup project, and I am able to read the selected value from a Custom Action.

I need to persist that value. The most common solution is to use the Windows Registry. I am just wondering if we could persist it in the application properties itself, considering that the Installer Class is in the same application that's being installed.

This code doesn't throw any exception:

    public override void Install(IDictionary stateSaver)
    {
        base.Install(stateSaver);

        // Get the installation mode
        string INSTALLATION_MODE = Context.Parameters["INSTALLATION_MODE"];

        // Save the installation mode in the application properties
        Properties.Settings.Default.INSTALLATION_MODE = INSTALLATION_MODE;
        Properties.Settings.Default.Save();
    }

But the actual value is not persisted in the application properties. Much appreciated.

War es hilfreich?

Lösung

After a thorough research, I concluded that we must indeed use the Windows registry to persist these installation parameters. Thank you.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top