You will notice if you follow the WiX documentation that the IniFile element writes rows into the IniFile table. If you check the MSDN documentation you will find that the RemoveIniValuesAction removes data from the ini files when the associated components are removed. Thus, you need to have the properties you reference in your IniFile elements have the same values during uninstallation as they had during the previous installation.
So, in your case, you will need to preserve the values of DATABASE_DISPLAY1 & DATABASE_DISPLAY2 and restore those before RemoveIniValues (I would recommend restoring them sometime before InstallInitialize). When components are not transitive, component conditions are only evaluated when the feature containing the component is added/installed. When all features containing that component are removed, the component is removed (the condition isn't evaluated at that point). In a major upgrade, if the component doesn't exist in the upgrading product, it will also be removed (without respect to any component conditions). If you made the components transitive, then the components would be evaluated every single transaction, and would possibly be installed if the condition is true and uninstalled if the condition is false, so component conditions WILL NOT HELP YOUR SCENARIO. You need to preserve/restore the values of the referenced properties for your UI-less maintenance transactions to work. I believe Peter Shirtcliffe already mentioned preserving/restoring those properties in your previous topic. Blair -----Original Message----- From: justin hull [mailto:justin.h...@assetpoint.com] Sent: Tuesday, November 15, 2011 2:48 PM To: wix-users@lists.sourceforge.net Subject: [WiX-users] Getting error on writing INI section using addline I am posting this as a different topic for I got the answers I needed from the other post regarding basic msp stuff. I've narrowed down the specific problem I am having with my upgrade. The project (Attached) has a section that writes UI data (from a custom window) to an INI file. <Component Id="IniSettings_ORA" Guid="680F574C-3A78-4C45-ACBF-D12A80D675B0"> <IniFile Id="TABWARE.INI.DbItem" Action="addLine" Key="Database1" Name="TABWARE.INI" Section="database" Directory="VersionDir" Value="[DATABASE_DISPLAY1]" /> <IniFile Id="TARGETDIR.INI.DbVendor" Action="addLine" Key="Vendors" Name="TABWARE.INI" Section="[DATABASE_DISPLAY1]" Directory="VersionDir" Value="Oracle" /> <IniFile Id="TABWARE.INI.DBMS" Action="addLine" Key="DBMS" Name="TABWARE.INI" Section="[DATABASE_DISPLAY1]" Directory="VersionDir" Value="O[DBVERS]0" /> <IniFile Id="TABWARE.INI.ServerName" Action="addLine" Key="ServerName" Name="TABWARE.INI" Section="[DATABASE_DISPLAY1]" Directory="VersionDir" Value="[SERVER_NAME]" /> <IniFile Id="TABWARE.INI.TabVendor" Action="addLine" Key="TabVendor" Name="TABWARE.INI" Section="[DATABASE_DISPLAY1]" Directory="VersionDir" Value="oracle" /> <IniFile Id="TABWARE.INI.DbItem_blank" Action="addLine" Key="'=====" Name="TABWARE.INI" Section="[DATABASE_DISPLAY1]" Directory="VersionDir" Value="=====" /> <Condition>(DBTYPE = 2 AND (DATABASE_NAME <> "" AND DATABASE_NAME <> " " ) ) AND UILevel > 3</Condition> <CreateFolder /> </Component> <Component Id="IniSettings_ORA_test" Guid="97DA8A36-B721-48EF-BBBC-A5B24A87F31B"> <IniFile Id="TABWARE.INI.DbItem_test" Action="addLine" Key="Database2" Name="TABWARE.INI" Section="database" Directory="VersionDir" Value="[DATABASE_DISPLAY2]" /> <IniFile Id="TARGETDIR.INI.DbVendor_test" Action="addLine" Key="Vendors" Name="TABWARE.INI" Section="[DATABASE_DISPLAY2]" Directory="VersionDir" Value="Oracle" /> <IniFile Id="TABWARE.INI.DBMS_test" Action="addLine" Key="DBMS" Name="TABWARE.INI" Section="[DATABASE_DISPLAY2]" Directory="VersionDir" Value="O[DBVERS2]0" /> <IniFile Id="TABWARE.INI.ServerName_test" Action="addLine" Key="ServerName" Name="TABWARE.INI" Section="[DATABASE_DISPLAY2]" Directory="VersionDir" Value="[DATABASE_TEST]" /> <IniFile Id="TABWARE.INI.TabVendor_test" Action="addLine" Key="TabVendor" Name="TABWARE.INI" Section="[DATABASE_DISPLAY2]" Directory="VersionDir" Value="oracle" /> <Condition></Condition> <CreateFolder /> </Component> When the install is run as a full UI install the custom window appears, data is entered, the ini file is written to and all is well. When an upgrade is created (or I try an full install in passive mode) and run in /passive I get a 2109 error on this component. The error states: MSI (s) (08:34) [17:02:57:968]: Product: TabWare Xi 8.201 -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2109. The arguments are: , , What seems to be happening is that since there is no user input, the "code" that attempts to create a section with user data fails. If I run the upgrade with a UI it will work, but then the uninstall fails. Hard code something and it may work, but that is not a reasonable option. I already altered the condition to test for UILevel and that did not work, I still get the error. I wonder if installer tries to resolve the section name before testing the condition? Time constraints and skill effect me trying to write a custom action at this time. What I am trying to do is understand why my condition wont work and is there an internal property value I can use that will allow the installer to skip over these components. I got everything else to work, but this condition. (I inherited this project, starting from zero knowledge last month). I included the project and the log file. I hate to be a bother, but time constraints were placed that limit my options. Any help is greatly appreciated. Justin http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/file/n6998261/ TabWareXi8201_ini.wxs TabWareXi8201_ini.wxs http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/file/n6998261/ install8201.log install8201.log -- View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Getting-error- on-writing-INI-section-using-addline-tp6998261p6998261.html Sent from the wix-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users