[wix-users] Error when removing msi

Hoover, Jacob Jacob.Hoover at greenheck.com
Wed Mar 31 22:43:08 PDT 2021


1) Seems sketchy / fragile at best, but if one must do it, write a few CA’s to handle the install/rollback/upgrade/remove cases.
2) standard WIX/Windows installer abilities - https://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/add_a_file.html
3) https://wixtoolset.org/documentation/manual/v3/howtos/general/install_windows_service.html

As always,  https://www.firegiant.com/ <https://www.firegiant.com/>  can help you out if you are looking for a solution and don’t want to go through the pains of the learning curve (or don’t have the time).

On Apr 1, 2021, at 12:20 AM, Imran baloch <imran_ku07 at yahoo.com> wrote:


Hi Jacob,

Thanks for your reply. Sorry I am very new to wix.

 Actually my requirement was,

1) Add an entry in windows/drivers/etc/hosts file.
2) Put files in a folder.
3) Remove an windows service if exist and re install it.

I found on web I can use cmd. What else I can use?



Regards,
Imran Baloch
Microsoft MVP (2011-2016), DZone MVB, MCP, MCTS, MCPD, MCS(Gold Medalist)


On Wednesday, March 31, 2021, 09:16:06 PM GMT+4, Hoover, Jacob <jacob.hoover at greenheck.com> wrote:



Exe based CA’s are ugly at best.  Is there a reason you can’t author the changes as standard MSI actions?



From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Imran baloch via wix-users
Sent: Wednesday, March 31, 2021 4:43 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Imran baloch <imran_ku07 at yahoo.com>
Subject: [wix-users] Error when removing msi



Dear,
I have the following,
  <InstallExecuteSequence>      <Custom Action="ExecInstallService" Before="InstallFinalize" />      <Custom Action="ExecAddHostEntry" After="ExecInstallService" >NOT Installed AND NOT REMOVE</Custom>      <Custom Action="ExecRemoveService" After="ExecInstallService" >(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>      <Custom Action="ExecDeleteFiles" After="ExecRemoveService" >(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>    </InstallExecuteSequence>

<CustomAction Id='ExecRemoveService' Directory="INSTALLDIR" Execute="deferred" ExeCommand='cmd.exe /k "My.exe -remove & exit"' Return="check" Impersonate="no"></CustomAction>


But when there is no folder and I am getting error when removing. Is there is way to ignore if no folder exist,


Product: My Service -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: ExecInstallService, location: C:\Location\, command: cmd.exe /k "My.exe -remove & My.exe -install & exit"



____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/<http://www.firegiant.com>

NOTE: This email was received from an external source. Please use caution when opening links or attachments in the message.

NOTE: This email was received from an external source. Please use caution when opening links or attachments in the message.


More information about the wix-users mailing list