Friday, May 16, 2014

Open ClickOnce by Code in C#

Hi, i found the below logic from a site, That tells us, to open ClickOnce Application by Code, or by another application

Suppose i have installed "OneApp" and i want to open this from "TwoApp" Code then write the code in TwoApp as follow


            StringBuilder sb = new StringBuilder();
            sb.Append(Environment.GetFolderPath(Environment.SpecialFolder.Programs));
            sb.Append("\\");
            //publisher name is OneApp
            sb.Append("OneApp");
            sb.Append("\\");
            //product name is OneApp
            sb.Append("OneApp.appref-ms");
            string shortcutPath = sb.ToString();
            Console.WriteLine(shortcutPath);
            //Start the One App installed application from shortcut

            System.Diagnostics.Process.Start(shortcutPath);


Reference is taken from: http://robindotnet.wordpress.com/2010/03/21/how-to-pass-arguments-to-an-offline-clickonce-application/

No comments:

Post a Comment