Hello,
I need to call schtasks command with own XML file (settings, that are available for Scheduled Tasks in Installer itself, aren't enough for me), so I created a batch file with this command and placed it into Temporary folder (I placed some "debug sleeps" into the batch).
Then I defined Custom Action - Launch File, where I call the batch file (i.e. [&myTempBatch.bat] in "File to launch" box). To be able to create scheduled task, this action must be done under admin privileges, so I checked the "Run as Administrator" box.
Moreover I needed to set folder param as command line argument (to be able to set the scheduled task executable path according to user's installation folder choice), so I chose Application Folder from the folder tree - "[APPDIR]" in "Command line" box.
The joke is that if I close this argument ("[APPDIR]") into quotes in order to have parameter with path "C:\Program Files (x86)\CompanyFolder\..." instead of "C:\Program" (which happens if I do not enclose the [APPDIR] with quotes), the installation process crashes - cmd black window just flashes - obviously no action happened at all.
I also tried unchecking the "Run as Administrator" checkbox and now cmd black windows shows, but it all ends with "Access denied".
What am I doing wrong way and is there any way to do this with Admin rights (change some path or whatever)?
Any help will be appreciated.
George
FOLLOW US
Get the latest news in Application Packaging