설치가 끝날 때 응용 프로그램을 시작하는 사용자 지정 설치 관리자 클래스가있는 설치 프로젝트가 있습니다. 설치 과정에서 응용 프로그램 출력에 대한 바로 가기를 만듭니다. 설치가 잘됩니다. 그러나 바로 가기를 클릭하면 설치 프로그램이 다시 시작되고 응용 프로그램이 동시에 시작됩니까? 왜?C# 설치 프로젝트의 바로 가기 문제
아니, 내 사용자 정의 클래스의 코드는 다음과 같습니다
/// <summary>
/// Installer class to automatically launch the application at the end of the installation/
/// </summary>
[RunInstaller(true)]
public partial class InstallerStartApplication : Installer
{
/// <summary>
/// Initializes a new instance of the <see cref="InstallerStartApplication"/> class.
/// </summary>
public InstallerStartApplication()
{
InitializeComponent();
}
/// <summary>
/// Raises the <see cref="E:System.Configuration.Install.Installer.AfterInstall"/> event.
/// </summary>
/// <param name="savedState">An <see cref="T:System.Collections.IDictionary"/> that contains the state of the computer after all the installers contained in the <see cref="P:System.Configuration.Install.Installer.Installers"/> property have completed their installations.</param>
protected override void OnAfterInstall(IDictionary savedState)
{
base.OnAfterInstall(savedState);
}
// Override the 'Install' method.
public override void Install(IDictionary savedState)
{
base.Install(savedState);
}
// Override the 'Commit' method.
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
try
{
Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
Process.Start(Path.Combine(Directory.GetCurrentDirectory(), "IERssNotificator.exe"), "-c");
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}
// Override the 'Rollback' method.
public override void Rollback(IDictionary savedState)
{
base.Rollback(savedState);
}
}
I 설치하고 커밋 사용자 지정 작업에서이 작업을 시작합니다.
아니요, 내 코드를 참조하십시오 ... 위의 – Coolweb
설치 프로그램을 시작하는 정렬 대신 * 일반 * 바로 가기를 만들 수있는 방법이 있습니까? –
찾지 못했습니다. 마지막으로 WinAPI를 사용하여 커밋 작업에서 바로 가기를 만들었습니다. WScript.Shell 또는 http://www.msjogren.net/dotnet/eng/samples/dotnet_shelllink.asp 라이브러리 –