Archiv fr September, 2007

Will there be an updated ICE and _Validation table that supports the schema changes?

Sunday, 16. September 2007 at 7:33 pm

Our friends with WiX (principally blogger Rob Mensching) had some questions about the schema changes.  One of those questions was:


Question:
Will there be an updated ICE and _Validation table that supports the schema changes?


Context:


Windows Installer 4.5 supports adding a new bits



Which breaks ICE 45 and is out of range of the existing 4.0 _Validation table.


Answer:


Yes, we do have updates to our SDK Tools before we call development complete.  We have planned for this work to happen after the engine changes are complete.  Our habit is to make sure the engine changes are complete before we shift to SDK tools.


[Author: Robert Flaming]
This posting is provided “AS IS” with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.

Original post by Windows Installer Team

von bingen

Did you really mean to build a patching feature that we can’t patch to because of a schema change?

Sunday, 16. September 2007 at 6:46 pm

Our friends with WiX (principally bloggers Rob Mensching and Heath Stewart) had some questions about the schema changes.  One of those questions was:


Question:
Did you really mean to build a patching feature that we can’t patch to because of a schema change?


Context:


Windows Installer 4.5 supports adding a custom action that will run during patch uninstall.  For beta, this was accomplished by adding a new bit msidbCustomActionTypePatchUninstall to the CustomAction table.  Given the value of the bit msidbCustomActionTypePatchUninstall is 0×8000, it means the schema for the Type column of the CustomAction table changes from i2 (the integer column data type) to i4 (the double integer column data type)


Answer:


Thanks for bringing this to our attention.  No, this was not our intent.  As I recall, the change from an attribute bit in the i2 range to the upper half of the i4 range was a side effect from a bug fix.


Thanks for the suggestions to have a separate table or an separate “Ex” column in the same table.  These are both quality ideas for enabling supporting patching in this patching feature. 


Development is considering this feedback and is formulating their solution.


[Author: Robert Flaming]
This posting is provided “AS IS” with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.

Original post by Windows Installer Team

Abgelegt von MSI4.5, Beta, Tools Vendors
von bingen

MSDN posted Windows Installer 4.5 Beta documentation

Sunday, 16. September 2007 at 6:15 pm

Microsoft Developer Network (MSDN) now contains the Windows Installer 4.5 beta documentation.  From the What’s New in Windows Installer 4.5 page, you’ll find information on our new multi-package transaction APIs: MsiBeginTransaction, MsiEndTransaction, and MsiJoinTransaction.  You’ll also find context for the Embedded features including MsiEmbeddedUI table, MsiEmbeddedChainer table and the EmbeddedUIHandler prototype.


Many thanks to Mark, Jen, Matt, Lee, and Julie for getting these pages out to you.


[Author: Robert Flaming]
This posting is provided “AS IS” with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.

Original post by Windows Installer Team

Abgelegt von MSI4.5, Beta
von bingen

Make the impossible possible then talk about it.

Friday, 14. September 2007 at 12:16 pm

Derek made a guest appearance tonight at the weekly WiX toolset coding night. It was fun having him around again. We all caught up on the things that have happened in the last year or so. At the end of the night (about 1 AM), I dropped him off at his hotel downtown and drove back home. On my way home, I remembered a recent comment that was directed at Derek and I:

Derek and Rob, wouldn’t it be better to first document all the current 3.0 features (SecureObj, Torch, Pyro, Setupbld etc) then [sic] adding support for a beta?

My simple answer is, “No.” I think it is better to ensure that the WiX toolset supports as many of the available scenarios correctly as quickly possible. My primary goal is to make sure that setup developers can get their job done well and that the tools are not the obstacle blocking them.

That said, I recognize that documentation can greatly improve the speed at which developers can learn the tools. You will notice that with many of the new features going into the core toolset that there is a great deal more documentation than what has been provided in the past. We obviously have a lot of “documentation debt” that still needs filling in.

Ultimately though every user of the WiX toolset has access to the deepest level of documentation, the source code. As long as the WiX toolset supports the full set of features available from the Windows Installer then any developer can learn how to use them.

PS: No, I am not trying to argue that documentation is irrelevant. I’m just saying that with the finite number of resources that I have to put toward the project, making the impossible possible currently seems more valuable than going back and writing more documentation for that which is already possible.

tags: , , , , , , ,

Original post by Rob Mensching

Abgelegt von WiX
von bingen

Zataoca: Custom actions should be data driven.

Friday, 14. September 2007 at 11:47 am

As I noted a few months ago, the Windows Installer is a declarative installation engine not a procedural installation engine. That means if you are going to extend the installation engine (which is what custom actions essentially do) then you should follow the same principles the engine follows. Namely, your custom action should read data out of a table and act based on those declarative instructions.

Let me give an example. Let’s say you want to protect some user input (maybe a password) using DPAPI.* Your first thought should be, “What are the inputs to my custom action?” Those inputs are the columns for your custom action’s table. In this case, one column would contain the value to be encrypted (Formatted so the value of a Property could be encrypted). Another column would provide the optional entropy value (that helps further randomize the protected output). A third column would specify whether the value will be protected for the current user or as the local machine account (limiting the set of users that can decrypt the data). A final column would specify the name of the Property to output the encrypted value to.

Then you would write your custom action to read each row out of the table with those for columns and call the ::CryptProtectData() API filling in the appropriate parameters. By acting on the data from the custom table, we call your custom action a “data driven custom action”.

Those of you whose first instinct was to say, “Oh, I’ll just write the code to get the value of a property called FOO and call the ::CryptProtectData() function with a bunch of parameters and write the value back out to a property called BAR.” should go back an reevaluate all of the custom actions you’ve ever written. This type of custom action is what we call a “procedural custom action” and it is inferior to the data driven method. Unfortunately, to most developers procedural custom actions are also the most intuitive way to write code (because that’s how most code is written).

Data driven custom actions are better than procedural custom actions for many reasons. as noted in the beginning, data driven custom actions follow the same declarative model that the rest of the Windows Installer follows. That means you fit into the rest of the installation system appropriately

One example is that data driven custom actions can be affected by transforms. You might think, “Oh, well I don’t support administrative customizations so I don’t care about transforms.” That might be true but the most optimal form of patching uses transforms to affect the package. If your custom actions are not data driven, your transform must patch the custom action binary directly and that creates a much larger patch.

Data driven custom actions are also reusable. Another developer can use your custom action without modifying the code because the inputs all from from a table. The custom action library that comes with the WiX toolset works just like this. We write the actions to configure things like Users, FileShares, Web Sites, Virtual Directories, SQL Databases, etc and you can reuse those actions by providing your own data. Data driven custom actions paired with the extension model in WiX provides a very powerful platform for installation.

Data driven custom actions are also more transparent than procedural custom actions. Going back to the WiX toolset Web Site example. If you look at the tables in the MSI after adding a WebSite element it is very possible to predict what the installation is going to do. Procedural custom actions hide the data and the actions in the compiled code (you don’t write script custom actions do you?). Admittedly, the data driven custom actions still have code in a black box but well written data driven custom actions can be quite transparent. Take a spin through the WiX custom action library if you don’t believe me.

Now I wanted to say that *all* custom actions should be data driven from a table but there are some rare cases where it doesn’t make sense. The custom action at the end of the install that launches your “readme.txt” through a ::ShellExecute() may just need a simple property passed to it (that’s how the WixShellExec custom action works today).

However, any custom action that modifies system state (see #3 in my list of custom action classes) should definitely be a data driven custom action to participate in the installation transaction well. After I do an example of a data driven internal-only custom action (#1 from the list), I’ll dive into system modification custom actions and further demonstrate why they should be data driven.

Anyway, that’s a long blog entry that basically says, “If you have already failed and determined that you need a custom action, make sure you make it data driven.”

* Yes, I am going to walk step by step through this example at some time in the future.

tags: , , , , , , ,

Original post by Rob Mensching

Abgelegt von CustomAction
von bingen

Where is good, comprehensive training covering the Windows Installer?

Saturday, 8. September 2007 at 4:04 pm

Our friend and blogger Aaron Stebner asked on behalf of his readers whether the Windows Installer had recommendations for “good, comprehensive training covering” the Windows Installer. This question comes up regularly and I’ve built up the following stock answer.



Windows Installer depends on our tools vendors to provide a considerable portion of our end to end story. There is an opportunity for the Tools Vendors to differentiate themselves in the market with the degree to which they onboard their users quickly and given them all the information they need to be successful.


Where education value from the tools vendors is not available or incomplete, one can drop down and build expertise in bare metal Windows Installer.  One should expect bare metal Windows Installer expertise does take time to build as we are a system technology with a lot of interdependencies with other parts of the system (the nature of being an installer). What we provide is the Windows Installer portion of the Windows Platform Software Development Kit which contains a lot of information on ‘what?’ is in Windows Installer but has very little ‘why?’, ‘when?’, and ‘how do I?’.


There is a broad range of resources available in the community for someone to build their expertise. In the Platform SDK, there is a topic “Other Sources of Windows Installer Information” which a long list of links to things like Whitepapers, Newsgroups, Blogs, Web Sites, Tools Vendors, Chat transcripts, and Knowledge Base articles.


If you’re interested in direct hands on help on a particular incident, there are a set of experts in Microsoft Product Support and Services that have deep knowledge of the Windows Installer. They are kind of hard to find so you may have to ask for the Windows Installer support team directly. If you’re in interested in training a group within your company, Microsoft Consulting Services does offer a week long on-site training on the Windows Installer. Mark Lathrope has provided the MCS services in the past.


One of the Windows Installer Most Valuable Professionals, Phil Wilson, has written a book “The Definitive Guide to Windows Installer” that I’ve heard good reviews about. Inside the Windows Installer team, Phil’s book is on the list of new hire resources we recommend folks use to ramp up.


Another of the Windows Installer Most Valuable Professionals, Stefan Kruger, runs a web site http://installsite.org which offers training as well a number of other services. As I view Stefan’s catalog of classes, most of Stefan’s classes are specific to the authoring application that one uses to author packages.


I’ve noticed that when I give this answer in person, customers have appeared a bit deflated as they were hoping for more from the Windows Installer team itself. For us, it’s a tough trade-off as building better training and education competes with building features into the engine that folks would like us to have.


[Author: Robert Flaming]
This posting is provided “AS IS” with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.

Original post by Windows Installer Team

von bingen

A starting point for Windows Installer 4.5 embedded UI?

Saturday, 8. September 2007 at 6:48 am

A few questions have come in asking for a starting point for building a Windows Installer 4.5 Embedded UI.


Feature Design


As we put together the ideas behind the Embedded UI features, we aspired to provide a simple extension off the preexisting features in the Windows Installer platform.

Simple Starting Idea


When we started designing this feature, our target scenario went something like this:


An ISV has spent a lot of time building a really cool external UI for their Windows Installer based experience users have a habit of trying to invoke the .MSI file directly rather than the setup.exe bootstrapper file. Generally this ISV puts up an plain dialog “Please invoke [ProductName] from the setup.exe file next to this file.”. It wastes the users time and hurts the package’s customer satisfaction.

Over time, we added nuances to this feature but our base assumption was that the ISV was the type of ISV that was ready to invest into an external UI.

Guiding Principle: what would an external UI do?


With the simple idea that a package author just wanted to put their custom UI inside the package, most of the complexity we referenced back to our guiding principle: what would an external UI do? We even considered a “zero cost migration from external UI” requirement but it didn’t fit scenarios or the ISV persona who was already prepared to build custom code to get their custom UI experience. A little more code was acceptable as long as reuse was in reach.


Friends and Foundations


One of the other early tests we had for ourselves was whether we thought the friends of Windows Installer could use this feature with the foundations already in place. Some of our bigger ISV and Tools Vendor friends already had custom external UI handlers so we wanted the cost for them to be low to build from their foundation. For smaller or newer ISV or Tools Vendors, we scouted our documentation and samples for a viable starting point for their foundation.


A Starting Point


For an ISV without a preexisting starting point, here’s what we thought you’d could build your foundation from.


First think of DLL custom action


When custom actions are needed, DLL custom actions are the way to do. They provide the capacity for the maximum integration with our architecture, including message passing for UI and logging, ability to read the database in the session, and the ability to request being executed NoImpersonated. Further most of the tools provide some starting framework to get an ISV off the ground with a DLL custom action. For us, considering the Embedded UI handler as a specialized version of a DLL custom action allowed us to reuse our custom action sandbox as the embedded UI sandbox.


Second think of external UI message processing


Once the Embedded UI DLL has been booted, it needs to do it’s work. The next thing a UI handler will need is to process messages. Although we do not currently have a external UI sample in the Windows Installer portion of the Platform SDK, we do have some code samples in the MSDN documentation. Of these, there is sample code for MsiSetExternalUI and MsiSetExternalUIRecord. Of the messages, progress is the one that will occur most frequently so we have a sample for that. Once the progress sample is in place, the work remaining is to expand the number of case statements handled to match the list of message types from INSTALLUI_HANDLER_RECORD. These case statements will each need to decide whether further parsing is required and we’ve documented that too at Parsing Windows Installer Messages. Sometimes the message parsing is going to require communicating a message back to the Windows Installer which you can learn to do with Returning Values from an External UI Interface Handler.


Third switch to your favorite User Interface design environment


The Windows Installer UI tables are from the Wizard 97 era of UI guidelines. User Interface design has some a long way in the 10 years since and the Windows Installer UI tables have not tried to keep up all that much. The Windows Installer team has advised ISVs seriously consider building their own favorite UI when they reach the limits of the Windows Installer.


How about a sample?


Sorry, we don’t have one yet but we do have it in the list of feedback that we plan to work on after we finish the engine work itself.


[Author: Robert Flaming]
This posting is provided “AS IS” with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.

Original post by Windows Installer Team

Abgelegt von Design Pointers, MSI4.5, Beta
von bingen

Windows Installer 4.5 and the WiX toolset.

Tuesday, 4. September 2007 at 8:46 am

If you follow the world of the Windows Installer at all, I’m sure you have noticed that the Windows Installer 4.5 Beta was made available last week.  Navigating the Connect sign up process is incredibly onerous but necessary if you want to get a hold of the new MSI.CHM and see the feedback provided thus far.

If you follow the WiX toolset then you might be wondering what our plans are for supporting MSI 4.5.  Well, last Thursday I read through the new features.  There were three new bit flags and two new tables that would need coverage in the WiX toolset.  Since adding new bit flags is usually quite easy, I whipped out the changes for the three new bit flags in both WiX v2 and WiX v3 that night.

Of course, nothing is that simple and I ran into two problems:

  1. The new msidbCustomActionTypePatchUninstall value is 0×8000 (32768). Unfortunately, that value goes into the CustomAction.Type column that is defined as an Integer (i2).  The Integer column in MSI only supports values from -32767 to 32767.  So I would need to bump up the Type column to a DoubleInteger (i4). Unfortunately, if I did that then the new versions of the WiX toolset would not be able to patch previously created MSI files (because you can’t transform column types in MSI). Does anybody else find it ironic that a bit flag added to enable more patching scenarios actually makes it impossible to patch older MSI files?
  2. The Windows Installer 4.5 Beta did not ship a new .cub file that understands the new bit flags. Thus, when you build an MSI using WiX v3 (that automatically validates your MSI files after link) that has one of these new bit flags you will always have an ICE45 error. Fortunately, we can suppress ICE45 in WiX v3 by added “-sice:ICE45″ to the light.exe command-line.

 After thinking about these problems for a couple days, I decided to back out my changes to WiX v2.  I decided to back out the changes because WiX v2 is supposed to be our stable branch and adding support for a Beta release of the Windows Installer seems to go against that goal. I’ll add full support to WiX v2 when MSI 4.5 releases.

I also chose not completely support msidbCustomActionTypePatchUninstall in WiX v3 yet. WiX v3 has the new attribute (CustomAction/@PatchUninstall=’yes/no’) for the new bit flag but if you use it your MSI will fail to link because the CustomAction.Type column definition is still Integer (i2) and 0×8000 won’t fit. This is a big problem for authoring tools and developers so I expect the Windows Installer team is going to have to come up with a different solution (like add a new column on the end of the CustomAction table called TypeEx  <grin/>).

That just left the new MsiEmbeddedUI and MsiEmbeddedChainer tables for the core WiX toolset to support all of the MSI 4.5 Beta features. So I sat down today, busted out the changes to WiX v3 to support the new tables, got Bob to review the changes and checked all of the changes in.  You can see support for the MSI 4.5 Beta in CVS right now.  We’ll have a build tomorrow so people can start playing with the new features, if they so choose.

So that’s the plan.  When MSI 4.5 releases (early next year, I hear) WiX v2 will be enhanced to support the new features.  WiX v3, on the other hand, has support for the new MSI 4.5 features about 10 days after the Beta was released.  We’ll keep updating WiX v3 as more details are made available by the Windows Installer team.

 

Original post by Rob Mensching

Abgelegt von WiX
von bingen