Question

I'm using wix IniFile element to edit ini file on install. When I try to uninstall i get error 2343:

Начало действия 12:37:47: RemoveIniValues.
MSI (s) (7C:BC) [12:37:47:264]: Note: 1: 2343 
DEBUG: Error 2343:  Specified path is empty.

My wxs with ini editing is as follows:

<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
 <Fragment>
<Property Id="miktex_config_path" Hidden="yes"/>
<SetProperty Id="miktex_config_path" Value="[INSTALLLOCATION]miktex\miktex\config"     After="InstallFiles" Sequence="execute">Not Installed</SetProperty>
<DirectoryRef Id="dirC060208F28327102C690BFF33C18B6C4">
   <Component Id="miktex_config_file"   Guid="4B9400C2-7EEF-4233-881D-5DFE6F80BB5B">
    <CreateFolder />
    <IniFile Directory="miktex_config_path" Id="common_install_path" Name="miktexstartup.ini" Action="addLine" Key="CommonInstall" Value="[INSTALLLOCATION]miktex" Section="Paths"/>
    <IniFile Directory="miktex_config_path" Id="common_data_path" Name="miktexstartup.ini" Action="addLine" Key="CommonData" Value="[CommonAppDataFolder]miktex_data" Section="Paths"/>
    <Condition><![CDATA[Not Installed]]></Condition>
   </Component>
  </DirectoryRef>   
 </Fragment>
</Wix>

Why doesn't uninstaller take into account my condition element?

How can I force installer to ignore ini file editing during uninstall?

Was it helpful?

Solution

The condition is against the component, however the action that is running is RemoveIniValue. You can surpress this action by overriding InstallExecuteSequence as follows:

<InstallExecuteSequence>
   <RemoveIniValues Suppress="yes" />
</InstallExecuteSequence> 

OTHER TIPS

It depends on the task you pursue. If you need to prevent INI value removal at all then suppressing the RemoveIniValues in the InstallExecuteSequence is the way to go as suggested by David Martin. However, that suppression (NO MATTER what you put as a condition for that), prevents the INI entry removals and for install and for uninstall (again, condition doesn't work, don't even try to put condition to suppress on uninstall only). But if you need to allow INI entry/tag removals during the install (IniFile declaration with remove action) but at the same time you need to prevent the rest of your INI settings from removal during the uninstall, then simply mark the Component where you keep your IniFile declarations as Permanent="yes". In that case your INI settings will not be removed on uninstall and your declarations to remove particular INI settings on install will work, And forget about the RemoveIniValues suppression at all.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top