My batch file that I'm trying to run when an Excel plugin needs to be uninstalled is not executing. I'm using the following custom actions to do post install and also on uninstalling the product. The following code:
<CustomAction Id="registeraddin" ExeCommand="[INSTALLFOLDER]RegisterMilerAddIn.bat" Directory="INSTALLFOLDER" Impersonate="no" Execute="deferred" Return="asyncWait" />
<CustomAction Id="unregisteraddinpostinstall" ExeCommand="[INSTALLFOLDER]UnRegisterMilerAddIn.bat" Directory="INSTALLFOLDER" Impersonate="no" Execute="deferred" Return="asyncWait" />
<InstallExecuteSequence>
<Custom Action="registeraddin" After="InstallFiles">NOT Installed</Custom>
<Custom Action="unregisteraddinpostinstall" After="InstallFiles">Installed AND (REMOVE = "ALL")</Custom>
</InstallExecuteSequence>
Produces this error in the log:
MSI (s) (44:04) [11:29:00:437]: Executing op: ActionStart(Name=unregisteraddinpostinstall,,)
MSI (s) (44:04) [11:29:00:437]: Executing op: CustomActionSchedule(Action=unregisteraddinpostinstall,ActionType=1058,Source=C:\Program Files (x86)\Werner Enterprises\Web Miles Excel Addin\,Target=C:\Program Files (x86)\Werner Enterprises\Web Miles Excel Addin\UnRegisterMilerAddIn.bat,)
MSI (s) (44:04) [11:29:00:846]: Note: 1: 1722 2: unregisteraddinpostinstall 3: C:\Program Files (x86)\Werner Enterprises\Web Miles Excel Addin\ 4: C:\Program Files (x86)\Werner Enterprises\Web Miles Excel Addin\UnRegisterMilerAddIn.bat
MSI (s) (44:04) [11:29:00:846]: Note: 1: 2205 2: 3: Error MSI (s) (44:04) [11:29:00:846]: Note: 1: 2228 2: 3: Error 4: SELECT
Message
FROMError
WHEREError
= 1722 CustomAction unregisteraddinpostinstall returned actual error code 100 (note this may not be 100% accurate if translation happened inside sandbox)MSI (s) (44:04) [11:29:10:900]: Note: 1: 2205 2: 3: Error MSI (s) (44:04) [11:29:10:900]: Note: 1: 2228 2: 3: Error 4: SELECT
Message
FROMError
WHEREError
= 1709MSI (s) (44:04) [11:29:10:900]: Product: WebMiles_Addin_Installer -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action unregisteraddinpostinstall, location: C:\Program Files (x86)\Werner Enterprises\Web Miles Excel Addin\, command: C:\Program Files (x86)\Werner Enterprises\Web Miles Excel Addin\UnRegisterMilerAddIn.bat
That error is obscure to me. I'm not doing real fancy stuff in my batch file either. The installation of the Excel addin works fine (which is the premise of this application). But I can't uninstall the addin, apparently, in the same manner, so goes the aforementioned error in the log.
For completeness, this is the contents of of my register batch (RegisterMilerAddIn.bat):
SET WorkFolder= "C:\Program Files (x86)\Werner Enterprises\Web Miles Excel Addin"
SET _NET_4_Folder= %WinDir%"\Microsoft.NET\Framework\v4.0.30319"
%_NET_4_Folder%\regasm.exe %WorkFolder%\Miler.ExcelAddin.dll /Codebase /tlb:%WorkFolder%\Miler.ExcelAddin.tlb >> C:\temp\log.txt
And unregister batch (UnRegisterMilerAddIn.bat):
SET WorkFolder= "C:\Program Files (x86)\Werner Enterprises\Web Miles Excel Addin"
SET _NET_4_Folder= %WinDir%"\Microsoft.NET\Framework\v4.0.30319"
%_NET_4_Folder%\regasm.exe /unregister %WorkFolder%\Miler.ExcelAddin.dll /Codebase /tlb:%WorkFolder%\Miler.ExcelAddin.tlb >> C:\temp\log.txt