[英]How to use System.Configuration.Install.Installer with scheduled tasks?
The subclasses of System.Configuration.Install.Installer
are useful in combination with InstallUtil.exe
because of the transactional behavior and easy uninstallation. 由于事务行为和易于卸载,因此
System.Configuration.Install.Installer
的子类与InstallUtil.exe
结合使用非常有用。
My particular app needs create a scheduled task (Windows Task Scheduler) when installed, and delete this scheduled task when uninstalled. 我的特定应用程序需要在安装时创建计划任务 (Windows Task Scheduler),并在卸载时删除此计划任务。 I see there is a
ServiceInstaller
for services, but is there something equivalent for scheduled tasks? 我看到有用于服务的
ServiceInstaller
,但是否有与计划任务等效的东西? or what is the suggested approach for creating/deleting tasks as part of (un)installation? 或在(取消)安装过程中创建/删除任务的建议方法是什么?
You can write a script file that calls schtasks.exe 您可以编写一个调用schtasks.exe的脚本文件。
To install a task 安装任务
schtasks /Create ...
To uninstall a task 卸载任务
schtasks /Delete ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.