This article is a mirror article of machine translation, please click here to jump to the original article.

View: 16162|Reply: 2

[New Issue] There will be problems running the InstallShield installation package using Silent Mode within the Setup Project project

[Copy link]
Posted on 8/28/2018 11:56:12 AM | | |
Hello gods,

I have been using Setup Project to package the program recently, and it is called A.
Due to project requirements, I had to install an installation package B packaged by InstallShield during the installation of A.
In this. AfterInstall and this.BeforeUninstall parts add the code of "Install" and "Reverse Install" B respectively.
However, it could not be executed smoothly, and the setup.log generated by B obtained ResultCode=-3, but the reason is unknown...

I beg the board god to help, this problem has troubled my little brother for a long time, and I have not been able to solve it... Thank you!!

In the following code, the code in the InstallerHelper_AfterInstall and InstallerHelper_BeforeUninstall is placed in the newly created C# console program, but it can run normally.
And WaitforExit() can also get stuck smoothly, and the B installation package can also be executed smoothly, ResultCode=0.

The code is as follows:
--
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Threading.Tasks;
using System.Configuration;
using System.Windows;
using System.IO;
using System.Diagnostics;
using System.Threading;

namespace FRWebService
{
    [RunInstaller(true)]
    public partial class InstallerHelper : Installer
    {
        public InstallerHelper()
        {

            InitializeComponent();

            this. BeforeInstall += new InstallEventHandler(InstallerHelper_BeforeInstall);
            this. AfterInstall += new InstallEventHandler(InstallerHelper_AfterInstall);

            this. BeforeUninstall += new InstallEventHandler(InstallerHelper_BeforeUninstall);
            this. AfterUninstall += new InstallEventHandler(InstallerHelper_AfterUninstall);
        }

        private void InstallerHelper_BeforeUninstall(object sender, InstallEventArgs e)
        {
            try
            {
                String arg = "/s /uninst";
                Process p = Process.Start("C:\\Program Files\\Test\\setup_io.exe", arg);
                p.WaitForInputIdle();
                p.WaitForExit();

            }
            catch (Exception ex)
            {

            }
        }

        private void InstallerHelper_BeforeInstall(object sender, InstallEventArgs e)
        {

        }

        private void InstallerHelper_Committing(object sender, InstallEventArgs e)
        {

        }

        private void InstallerHelper_Committed(object sender, InstallEventArgs e)
        {

        }

        private void InstallerHelper_AfterInstall(object sender, InstallEventArgs e)
        {
            try
            {
                String arg = "/s";
                Process p = Process.Start("C:\\Program Files\\Test\\setup_io.exe", arg);
                p.WaitForInputIdle();
                p.WaitForExit();
            }
            catch (Exception ex)
            {

            }
        }

        private void InstallerHelper_AfterUninstall(object sender, InstallEventArgs e)
        {


        }


        //Code to perform at the time of installing application
        public override void Install(System.Collections.IDictionary stateSaver)
        {
            System.Diagnostics.Debugger.Launch();
            base. Install(stateSaver);
            System.Windows.Forms.MessageBox.Show("Installing Application...");
        }

        public override void Uninstall(System.Collections.IDictionary stateSaver)
        {
            System.Diagnostics.Debugger.Launch();
            base. Uninstall(stateSaver);
            System.Windows.Forms.MessageBox.Show("Uninstalling Application...");
        }

    }
}
--





Previous:Linq implements not in and in conditional queries in SQL
Next:mysql queries tables built at a certain time in a database
Posted on 8/28/2018 1:02:49 PM |
Can you paste setup.log logs? Or run the installation as an administrator and try it?
 Landlord| Posted on 8/28/2018 2:21:53 PM |
This post was last edited by yishiang0217 on 2018-9-3 09:47
admin posted on 2018-8-28 13:02
Can you paste setup.log logs? Or run the installation as an administrator and try it?

Hello administrators,

Nice to receive your reply, here are the answers to your questions:

1.
That's all setup.log is about @@
--
[ResponseResult]
ResultCode=-3
--
Or can InstallShield print more?!

2.
Setup Project will generate two files, one is msi and the other is an exe, I tried to run the exe as an administrator, but I couldn't...

P.S. The part that has been successful so far is... Run the B installation package when AfterInstall, but don't use WaitForExit, you can install it smoothly and silently... But because B is installed and packaged, I still have to do some operations...
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com