CopyMinder Knowledge Base

Browse by Category:
Lookup Error Number:

Glossary   |   Contact Us

CMInstall with Microsoft ClickOnce

Views: 1589
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";
        { } while (!process.WaitForExit(200));
        if (process.ExitCode != 0)
            MessageBox.Show("Please report the following CMInstall error code: " + process.ExitCode.ToString());

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?

Microcosm Ltd.

Valid XHTML 1.0    Valid CSS 2.0