Blair,

Thanks for the input and pointing me to relevant documentation.  I had to read 
this a few times to understand, but what I get is that because of the nature of 
the inifile element and its relationship with a table, we need to store off the 
user data on install, then on upgrades, retrieve and set the variables.  (Now I 
have to figure out how and when).

I did not understand one phrase, "If you made the components transitive" and 
"components are not transitive ".  I did find this link 
(http://msdn.microsoft.com/en-us/library/aa372462%28VS.85%29.aspx) and it would 
seem that if I set a component to be transitive, then it will be evaludated not 
just at initial install, but on "reinstall" which I took to mean upgrade.  
However there is a caveat that talks about "conditions based on user states or 
properties set on the command line".  Would that apply to user input from a 
custom form.  I think so, but not sure.

My alteration for the future will be along the lines of either a custom action 
or like you stated, save off the values.  This is very rich meat to digest and 
I thank you for all the input.

Justin Hull

[cid:image003.jpg@01CCA440.DB614930]
Office: 864-679-3500 (3413)


From: Blair Murri-3 [via Windows Installer XML (WiX) toolset] 
[mailto:ml-node+s687559n6998750...@n2.nabble.com]
Sent: Tuesday, November 15, 2011 8:26 PM
To: Justin Hull
Subject: Re: Getting error on writing INI section using addline

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:[hidden 
email]</user/SendEmail.jtp?type=node&node=6998750&i=0>]
Sent: Tuesday, November 15, 2011 2:48 PM
To: [hidden email]</user/SendEmail.jtp?type=node&node=6998750&i=1>
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
&lt;&gt; "" AND DATABASE_NAME &lt;&gt; " " ) ) AND UILevel &gt;
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
[hidden email]</user/SendEmail.jtp?type=node&node=6998750&i=2>
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
[hidden email]</user/SendEmail.jtp?type=node&node=6998750&i=3>
https://lists.sourceforge.net/lists/listinfo/wix-users

________________________________
If you reply to this email, your message will be added to the discussion below:
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Getting-error-on-writing-INI-section-using-addline-tp6998261p6998750.html
To unsubscribe from Getting error on writing INI section using addline, click 
here<http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6998261&code=anVzdGluLmh1bGxAYXNzZXRwb2ludC5jb218Njk5ODI2MXwtMTI4MTg0Nzg4NQ==>.
NAML<http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Getting-error-on-writing-INI-section-using-addline-tp6998261p7000513.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

Reply via email to