문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top