Ejemplo n.º 1
0
        private void mnuInstallMshcHelpFile_Click(object sender, EventArgs e)
        {
            var frm = new InstallMshcForm();

            frm.LocaleName.Text = _currentLocale;

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            string HelpLibManagerExe = @"c:\program files\Microsoft Help Viewer\v1.0\HelpLibManager.exe";
            string arguments         = String.Format(@"/product {0} /version {1} /locale {2}", frm.ProdName.Text, frm.VersionName.Text, frm.LocaleName.Text);

            // Install
            if (frm.MshaFileTextBox.Text.Length != 0)
            {
                arguments = arguments + String.Format(@" /sourceMedia {0}", frm.MshaFileTextBox.Text);
            }

            if (File.Exists(HelpLibManagerExe) == false)
            {
                MessageBox.Show("File not found: " + HelpLibManagerExe);
                return;
            }

            var process = new Process();

            process.StartInfo.FileName        = HelpLibManagerExe;
            process.StartInfo.Arguments       = arguments;
            process.StartInfo.UseShellExecute = true;
            process.StartInfo.Verb            = "runas"; //run as administrator -- Required for installation
            process.Start();
        }
Ejemplo n.º 2
0
        private void mnuInstallMshcHelpFile_Click(object sender, EventArgs e)
        {
            var frm = new InstallMshcForm();
            frm.LocaleName.Text = _currentLocale;

            if (frm.ShowDialog() != DialogResult.OK)
                return;

            string HelpLibManagerExe = @"c:\program files\Microsoft Help Viewer\v1.0\HelpLibManager.exe";
            string arguments = String.Format(@"/product {0} /version {1} /locale {2}", frm.ProdName.Text, frm.VersionName.Text, frm.LocaleName.Text);

            // Install
            if (frm.MshaFileTextBox.Text.Length != 0)
                arguments = arguments + String.Format(@" /sourceMedia {0}", frm.MshaFileTextBox.Text);

            if (File.Exists(HelpLibManagerExe) == false)
            {
                MessageBox.Show("File not found: " + HelpLibManagerExe);
                return;
            }

            var process = new Process();
            process.StartInfo.FileName = HelpLibManagerExe;
            process.StartInfo.Arguments = arguments;
            process.StartInfo.UseShellExecute = true;
            process.StartInfo.Verb = "runas"; //run as administrator -- Required for installation
            process.Start();
        }