How to handle checkbox controls in windows installer?

独自空忆成欢 提交于 2019-12-17 21:32:31

问题


I am using Visual Studio 2008 to create a setup project. I want to create a file which will contain values of the checkboxes which are selected by user during installation. How and where to write the code for the same? I am new to windows installer. Please provide me pointers for the same. Thank you in advance.


回答1:


You can easily do it with installer class.

  1. First of add installer class to your setup project. Go to Add > Add New Item > Select Installer class

  1. Create a Window Form with radio button to get user input and logic to save selected values to a text file.

  2. Within installer class`s Install method open windows form to get the user input. So during the installation windows form will pop up where user can select the values.(Please not that this form will not open as a modal pop up)

Install()

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

            Form1 form = new Form1();
            form.ShowDialog();
        }

Best approach

Best approach to get the user input during the installation is to create .wid file. See my post here.



来源:https://stackoverflow.com/questions/19460520/how-to-handle-checkbox-controls-in-windows-installer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!