windows installer - Why is it a good idea to limit the use of custom actions in my WiX / MSI setups? -


why idea limit use of custom actions in wix / msi setups?


deployment crucial part of development. please give content chance. firm belief software quality can dramatically improved small changes in application design make deployment more logical , more reliable - "answer" - software development.


this q/a-style question split answer became long: how avoid common design flaws in wix / msi deployment solution?.

as stated above this section split existing answer broader scope: how avoid common design flaws in wix / msi deployment solution? (an answer intended developers make better deployment decisions).


6. erroneous or unnecessary use of custom actions.

a plethora of deployment problems can caused custom action use - of them serious. if setup fails complete or crashes, fair bet erroneous custom action @ fault.

accordingly obvious solution limit use of custom actions whenever possible. custom actions "black box" (hidden code) whereas of msi features lot of transparency. msi format can viewed easily, , msi file can deduced msi database file - exception of compiled custom actions.

6.1 overuse of custom actions

  • developers @ coding - tend overuse custom actions things better done using built-in msi features or ready-made msi extension solutions such available in wix advanced things such xml file updates, iis, com+, firewall rules, driver installation, custom permissioning disk , registry entries, modify nt privileges, etc... such support found in commercial tools such installshield , advanced installer.

  • custom actions in windows installer complex regards implementation, scheduling , rollback, , should used when absolutely necessary. the common unnecessary custom action uses see in opinion:

    • you install windows services via custom actions. better done in msi using built-in constructs.

    • you install .net assemblies gac via custom action. supported windows installer without line of (risky) code.

    • you run custom .net assembly installer classes. these used development , testing only. should never run part of deployment. rather msi should use built-in constructs deploy , register assembly.

    • you run prerequisite setups , runtime installers via custom action in own msi. should done entirely differently. need bootstrapper can launch setup , prerequisites in sequence. commercial deployment tools such advanced installer , installshield have features this, free frameworks such wix has support via burn feature, , there free gui applications such dotnetinstaller (untested me) these kind of features.

    • please take word in particular case: running embedded setups via custom action fail eventually - rather immediately. msi complicated in scheduling, impersonation, transaction, rollback , overall runtime architecture make possible. 1 msi transaction can run @ time design, , makes things complicated. used run embedded msi files concept in msi, deprecated - didn't work properly. must run each setup in sequence. correct sequence.

6.2 custom action alternatives

  • the ready-made solutions found in wix , other tools such installshield , advanced installer, tried , tested, , crucially implement proper rollback support - feature missing custom action implementations - in otherwise vendor msi setups. rollback important msi feature. cannot compete quality delivered large user community active use , testing in kinds of environments. make use of these features.

  • apart using built-in msi constructs or wix custom features, custom actions can avoided minor changes application design complex custom actions no longer needed. see licensing example of how deployment can simplified improve reliability.

    • this important point, , 1 ignored. quality hours or days of coding , quality uat / qa time can prevent long term deployment problems ever existing. no amount of support time can solve worst deployment problems can create.

    • this answer provides blurb the overall complexity of deployment: windows installer , creation of wix (towards bottom). deployment complicated "delivery process" several serious challenges: 1) cumulative nature of deployment errors, 2) difficulty of proper debugging, , 3) virtually unlimited range of external factors , variables affecting target machines world-wide - conclusion deployment must made simple possible reliable. there many intervening factors leaving developer favorite: the intermittent bug. link above recommended more fleshed out explanation.

6.3 advanced custom action problems (beyond runtime failures)

  • a common custom action issue incorrect scheduling , attempting modify system "non elevated" immediate mode actions. these advanced msi design flaws not recognizable people see otherwise working setup.

  • never insert immediate mode custom actions after installfinalize in installexecutesequence of msi attempt modify system (read/write). these actions never run if setup deployed in silent mode via deployment systems such sccm (again, last time checked).

  • never try change system using immediate mode custom actions activated setup gui. appear work admin users, immediate mode custom actions not elevated , hence regular users not able run them without error. in addition changes system done msi gui never done when setup run in silent mode (then whole gui sequence skipped). this serious msi design flaw: installing silently , interactively causes different results. issue mentioned in section 10 on silent install in answer: how avoid common design flaws in wix / msi deployment solution?. silent install crucial feature corporate deployment of software. in corporations control of deployment, deployment done silently. setup gui never seen. there few exceptions can think of, such server deployments may done interactively, desktop , client software deployed silently. not supporting silent install properly hence horrendous deficiency , design flaw of msi file. please heed advice.

  • all custom actions make changes system must inserted in "transacted section" of installation sequence. windows installer transaction (think database transaction commit) runs between standard actions installinitialize , installfinalize in installexecutesequence , runs elevated rights. changes system take place in transaction - else erroneous (but unfortunately quite common). custom actions inserted here should have corresponding rollback custom action implemented well, , should undo changes done system in case install fails , gets rolled back.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -