Using InstallUtil
Install:
InstallUtil.exe algo.exe
Uninstall:
InstallUtil.exe /u algo.exe
Batch File To Install A service
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallUtil.exe
/showcallstack C:\...\bin\XXXService.exe
pause
Batch File To Uninstall A service
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallUtil.exe /u
/showcallstack C:\...\bin\XXXService.exe
pause
Programmatically
Add a reference to 'System.Configuration.Install'
Install:
String []installParams= {filename};
System.Configuration.Install.ManagedInstallerClass.InstallHelper(installParams);
Uninstall:
String []installParams= {"/u", filename};
System.Configuration.Install.ManagedInstallerClass.InstallHelper(installParams);
No comments:
Post a Comment