wix - CustomActionData with semi-colon separated, causes string overflow - What are the common workaround to this solution? -


there few attempts of questions answerered in regards ice03 (string overflow) customactiondata, cannot seem determine/conclude correct (or accepted) practice of how go around issue.

my current resolution reduce length of key-value-pair keeping both key , property names short, i.e. from:

<customaction id="mycustomactiondata"   property="mycustomactionca"   value="mykeyname1=[some_property_name];mykeyname2=[some_descriptive_propname]"/> 

to:

<customaction id="mycustomactiondata"   property="mycustomactionca"   value="k1=[k1];k2=[k2]"/> 

but feel i'm sweeping problem under rug , sooner or later, i'll encounter again (also, based on assumptions of additional question below).

the more obvious solution re-evaluate , re-design least amount of data needs passed down c# customaction (the classic "why want declare function method pass 20 parameters?" question code-reviewers). obviously, languages today, can redesign api , pass object (as class, struct, etc - depends on languages) self-contains needs, how 1 go inter-process calls (i've seen json rpc messages reasonably large data , i'd wonder if because tried fix legacy code adding more , more until got bloated rather sitting down , re-design, not possible on "11th hour" deadline has fixed in shortest time allowed).

perhaps solution create xml file , use expat ('util:xmlfile') search , replace key-value-pair before calling customaction, , pass filename of altered xml customactiondata customaction use, in c# customaction code, deserializes , treats objects. feels little klunky (it may confuse next developer takes on task in future), not mention if passwords we'd want not have in xml file , keep property hidden="yes"...

so question is, clean/elegant solutions or pattern (or practices) resolve issue of passing customactiondata may exceed table column size?

if may ask additional question related, assuming linker (light) warning lght1076 based on length of value (i.e. "keya=[a];keyb=[b]") being long, , if chose short property variable , key-names, not trigger warning. understand, table column size 255 characters (please correct me if i'm wrong) during run-time, if property value longer column size, can cause issue (or truncated)?

the solution use create multiple properties , concatenate properties @ end single property, way:

<customaction id="setsqlproperties"               property="sqlproperties"               value="sql_login_id=[sql_login_id];sql_password=[sql_password];                      sql_auth_type=[sql_auth_type];sql_servers=[sql_servers]" /> <customaction id="setserverproperties"               property="serverproperties"               value="domain=[domain];computername=[computer_name];                      fullservername=[fullcomputername];version=[productversion];                      servertype=[server_type];srvmode=[srvmode]" />  <customaction id="setpropertiesconfigreplace"               property="configreplace"               value="installfolder=[installfolder];[serverproperties];[sqlproperties]" /> 

in example use property [configreplace] containing values sql server , local server.

about ice03, in documentation can find this:

the string's length greater column width specified column definition. note installer not internally limit column width specified value. see column definition format. msdn


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -