CopyMinder Knowledge Base

Browse By Category:
 
Look Up Error Number:
 
Search:
 

Glossary   |   Contact Us


CMInstall with Microsoft ClickOnce

Views: 1696
Rating: 14
Rate It:

This is some code kindly donated to us by a CopyMinder user who wanted to run CMInstall.exe from ClickOnce.

We hope you find it useful.

if (ApplicationDeployment.IsNetworkDeployed)
{   // This is a clickonce application 
    ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;
    if (deployment.IsFirstRun)
    {   // is the first run of THIS version of the application
        if (!IsAdminRole())
            MessageBox.Show("This application must be initialised first. You might be prompted by Windows to elevate to " +
                                "Adminstrator level, please accept in that case.");
        System.Diagnostics.Process process = new System.Diagnostics.Process();
        process.StartInfo.FileName = "CMInstall.exe";
        process.StartInfo.WorkingDirectory = System.IO.Directory.GetCurrentDirectory();
        process.StartInfo.Arguments = "/k";
        process.Start();
        do
        { } while (!process.WaitForExit(200));
        if (process.ExitCode != 0)
        { 
            MessageBox.Show("Please report the following CMInstall error code: " + process.ExitCode.ToString());
            System.Windows.Application.Current.Shutdown();
            return;
        }
    }
}  
More Help

If this article did not help you to solve your problem, please use the menu at the top of the page to browse or search more articles, or to contact our support team.

Others in this Category
  
articleI don't seem to have a CD-ROM with the CopyMinder software on it
 
articleMy computer hangs when installing the CopyMinder SDK
 
articleHow do I create a Trial Only installation?
 
articleHow do I find the .cm and .cm.log files?
 
articleWhy is a Product Key not in a Report I have produced?
 

© 2024 Microcosm Ltd.

Valid XHTML 1.0 Valid CSS 2.0