How to run schtasks.exe from the installer of Visual Studio 2010?

I have a Visual Studio 2010 solution with several C ++ projects and a Windows Installer project.

The installer works for the most part when installing deployment directories, applications, and various shortcuts. the last thing I would like to do to the installer is to install a couple of tasks in the Windows task scheduler.

I can run schtask.exe from the command line and it works fine. I thought I could just copy the same command into CustomAction inside the installer. However, this does not work, and the installation completes with the message "There is a problem with this Windows Installer package. The program required for this installation cannot be started ..."

I add the System folder to the FileSystem setting, and in CustomActions I added CustomAction to the Commit node.

The CustomAction sourcePath property is set to C: \ Windows \ System32 \ schtasks.exe, and the Arguments property is "/ create / tn" "WiwoCLLauncher" "/ tr C: \ ECS \ WiwoCLLauncher.exe / sc ONSTART"

Can someone give an idea on how to run schtasks.exe from the VS2010 installer?

+4
source share
1 answer

The InitialAction sourcePath property is specified in C: \ Windows \ System32 \ schtasks.exe

, . schtasks.exe MSI. . , Windows . .

, . Orcas MSI ( 2 34), . , VS- VS, #, Process.Start() .

+4

All Articles