【问题标题】:How to use System.Configuration.Install.Installer with scheduled tasks?如何将 System.Configuration.Install.Installer 与计划任务一起使用?
【发布时间】:2012-02-16 01:12:37
【问题描述】:

System.Configuration.Install.Installer 的子类可与InstallUtil.exe 结合使用,因为它具有事务性行为和易于卸载。

我的特定应用需要在安装时创建一个计划任务(Windows 任务计划程序),并在卸载时删除此计划任务。我看到有一个ServiceInstaller 用于服务,但是有没有与计划任务等效的东西?或者在(卸载)安装过程中创建/删除任务的建议方法是什么?

【问题讨论】:

    标签: .net windows-installer scheduled-tasks


    【解决方案1】:

    你可以写一个脚本文件调用schtasks.exe

    安装任务

    schtasks /Create ...
    

    卸载任务

    schtasks /Delete ...
    

    【讨论】:

      猜你喜欢
      • 2016-02-10
      • 2010-09-28
      • 1970-01-01
      • 2017-08-01
      • 2022-11-14
      • 1970-01-01
      • 2013-12-29
      • 2021-04-12
      相关资源
      最近更新 更多