I had a perfectly good wix installer when it came to moving files from the cab file to the hard drive. The problems are all being caused by the way I am writing my custom action. First, I will show the culprit, then explain the symptoms.
<CustomAction Id="InstallElasticWithProvidedBatch" FileKey="fil85D231A31B2F8EB99C6B9EA4B95A354C" Impersonate="no" ExeCommand="install" Execute="deferred"/>
<CustomAction Id="RemoveElasticWithProvidedBatch" FileKey="fil85D231A31B2F8EB99C6B9EA4B95A354C" Impersonate="no" ExeCommand="remove" Execute="deferred"/>
<InstallExecuteSequence>
<Custom Action='InstallElasticWithProvidedBatch' Before='InstallFinalize'>NOT Installed</Custom>
<Custom Action='RemoveElasticWithProvidedBatch' Before='InstallFinalize'>REMOVE ~= "ALL"</Custom>
</InstallExecuteSequence>
What this code is supposed to be doing:
Run the service.bat script to install and uninstall elastic search as a service. When the application is first installed, it should run the bat with the parameter "install." When the application is uninstalled, it should run the bat with the perameter "remove."
What is happening (read a few times. It is pretty interesting):
Install goes perfectly fine! The files get put on disk and the service is installed properly. When I uninstall it, I get this message:
The application is then stuck in my Add/Remove programs menu and I have to manually delete the installed files and then sift through the registry to clear out the elastic search entry.
on SUBSEQUENT installs. The error message I linked you moments ago does not come back! AND the service is correctly removed. BUT the files that were installed now don't get touched anymore.
To reset the situation, I have to change the GUID on every single file referenced in the xml document, but that just gets me back to where the install says it doesn't have the program it needs to uninstall the application properly.
If I remove the custom actions, the installer works as intended (assuming I have changed all 50 guids since the last time the installer broke). Does anyone have any hints as to what to try next? I have burnt 5 hours on this issue.
Side note: A common thing for the WIX veterans to say is to not use a batch file at all and just convert the files functionality into native Wix, but that is not a very valuable process in this case. The .bat file is provided by elasticsearch and is incredibly cryptic.