I have the following XML in my .wxs file for running a batch file on uninstall:
<InstallExecuteSequence>
<Custom Action="uninstall_action" After="InstallInitialize">Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
</InstallExecuteSequence>
and
<Fragment>
<CustomAction
Id ="uninstall_action"
Directory ="INSTALLDIR"
ExeCommand =""[INSTALLDIR]uninstallTester.bat""
Execute ="deferred"
Impersonate="no"
/>
</Fragment>
So it should run a batch file located in the install directory. My batch file looks like this:
schtasks /Create /F /SC ONCE /ST 22:05 /TN exampleUninstall /TR "echo hello" 2> batch_log.log
When I run the uninstaller I get the following inside the batch_log.log:
ERROR: No mapping between account names and security IDs was done.
(40,4):UserId:
It seems to have a problem specifically only with creating a new scheduled task, because if I change the batch to remove a scheduled task, it runs without error. So my question is: how can I schedule this one time task to run? Also running the batch file by itself will also work, it just has a problem when being called by the uninstaller.
I've also tried googling that specific error with no luck.
I've simplified my actual use case, so I cannot merely just move the schtasks command into the ExecCommand in the installer, it must live inside a batch file (actually it will live inside an executable, but I thought this batch example is easier)