How to write custom action for C # installer in visual studio 2010?

I am writing an installer in Visual Studio 2010 for a 64-bit computer. There I use a custom action to get the value CheckBoxduring the installation process.

The custom action is as follows:

/cbvalue="[CHECKBOXA1]"

and in my installer class I added the following code to get the parameter:

string myInput = Context.Parameters["cbvalue"];

The installation project succeeds, but when I try to install the installation file, it causes the following error during installation:

Error: 1001 System.BadImageFormatException.could not load assembly .....

When I try to do this without adding a custom action, it installs correctly. And also I want to find a way to debug installation projects.

+3
2

Install(), :

public override void Install(System.Collections.IDictionary stateSaver) 
{ 
   base.Install(stateSaver); 
   stateSaver.Add("cbvalue", Context.Parameters["cbvalue"].ToString()); 
}

, - :

public override void Commit(System.Collections.IDictionary savedState) 
{ 
   base.Commit(savedState); 
   System.Windows.Forms.MessageBox(savedState["bcvalue"].ToString());    
}
0

64- , , , x86 , , msi ORCA, . , .

0

All Articles