views:

150

answers:

1

When ClickOnce deploys apps, it generates an .application file that allows you to execute the application, so the main application is builded on C++.Net 2003 using Fx1.1, when I told him that call the first file (.application file from ClickOnce Deployment C# 3.0 app) he didnt know how ¿?!

I trying to write some code snippet, the code below cant "open" the .application file generated from ClickOnce.. Thanks

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    System::Diagnostics::Process app ;
    app.StartInfo->FileName = "C:\INFORME\SRIMedico.application";
    app.StartInfo->Arguments = "";
    app.Start();

   }
+1  A: 

It's not very clear to me what is it exactly that you're looking for but as far as I know ClickOnce it not meant to be used to deploy VC++ applications.

See ClickOnce Deployment For Visual C++

Edit:

There's one thing that jumps out at me in your code example: You have not escaped the "\" character (which is a special character in C++) and in which case the path you supplied would be invalid. Please re-try it like this:


    // .. rest of code in your sample ommited 
    app.StartInfo->FileName = "C:\\INFORME\\SRIMedico.application";
    // .. rest of code in your sample ommited

Another thing that I overlooked earlier is that while you may use System::Diagnostics::Process to launch a ClickOnce application installer, it only works using the location where you originally installed the application from, not the location where the application was installed. See the Remarks section in the Process.StartInfo documentation.

You may also use the .appref-ms application reference file to launch the application, if you have it installed on the computer. Assuming this file is located in C:\INFORME\ you may write something like this:



    System::Diagnostics::Process^ app = gcnew System::Diagnostics::Process()
    app->StartInfo->FileName = "C:\\INFORME\\SRIMedico.appref-ms";
    app->StartInfo->Arguments = "";
    app->StartInfo->CreateNoWindow = "false";
    app->Start();

I hope this helps!

SRIMedico is and .application file generated by Deploying a C# 3.0 Application with ClickOnce
Angel Escobedo