こんにちは、神々よ、
最近、Setup Projectを使ってプログラムをパッケージ化しており、Aと呼ばれています。 プロジェクトの要件により、Aのインストール時にInstallShieldがパッケージしたインストールパッケージBをインストールしなければなりませんでした。 この件で。 AfterInstallとthis.beforeUninstallパーツはそれぞれ「Install」と「Reverse Install」Bのコードを追加しています。 しかし、スムーズに実行できず、Bによって生成されたsetup.logはResultCode=-3となりましたが、その理由は不明です...
板の神様に助けてください、この問題は長い間弟を悩ませていて、私は解決できていません... ありがとうございます!!
以下のコードでは、InstallerHelper_AfterInstallとInstallerHelper_BeforeUninstallのコードが新たに作成されたC#コンソールプログラムに配置されますが、通常通り実行可能です。 また、WaitforExit()もスムーズに詰まることがあり、Bインストールパッケージもスムーズに実行できます。ResultCode=0です。
コードは以下の通りです: -- Systemを使い、 System.Collectionsの使用; System.Collections.Genericを使い、 System.ComponentModelを使い、 System.Configuration.Installを使い、 System.Linqを使い、 System.Threading.Tasksを使い、 System.Configurationを使い、 System.Windowsを使い、 System.IO を用いる; System.Diagnosticsを使い、 System.Threadingを使い、
名前空間 FRWebService
{ [RunInstaller(true)] public partial class InstallerHelper : Installer { public InstallerHelper() {
InitializeComponent();
これ。 BeforeInstall += new InstallEventHandler(InstallerHelper_BeforeInstall); これ。 AfterInstall += new InstallEventHandler(InstallerHelper_AfterInstall);
これ。 BeforeUninstall += new InstallEventHandler(InstallerHelper_BeforeUninstall); これ。 AfterUninstall += new InstallEventHandler(InstallerHelper_AfterUninstall); }
private void InstallerHelper_BeforeUninstall(object sender, InstallEventArgs e) { やってみて { 文字列 arg = "/s /uninst"; Process p = Process.Start("C:\\Program Files\\Test\\setup_io.exe", arg); p.WaitForInputIdle(); p.WaitForExit();
} catch(例外例) {
} }
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) { やってみて { 文字列 arg = "/s"; Process p = Process.Start("C:\\Program Files\\Test\\setup_io.exe", arg); p.WaitForInputIdle(); p.WaitForExit(); } catch(例外例) {
} }
private void InstallerHelper_AfterUninstall(object sender, InstallEventArgs e) {
}
アプリケーションをインストールする際に実行すべきコード public override void Install(System.Collections.IDictionary stateSaver) { System.Diagnostics.Debugger.Launch(); 基地。 インストール(stateSaver); System.Windows.Forms.MessageBox.Show("アプリケーションのインストール中..."); }
public override void Uninstall(System.Collections.IDictionary stateSaver) { System.Diagnostics.Debugger.Launch(); 基地。 アンインストール(stateSaver); System.Windows.Forms.MessageBox.Show("アプリケーションのアンインストール..."); }
}
} --
|