Recently I've been doing some work for a customer who needs an installer for a Office 2007/2010 VSTO 2010 AddIn. While authoring the actual installer isn't that difficult thanks to the awesome bootstrapper in InstallShield 20xx, the real fun has been on the integration and testing side.
Making sure this your product and installer will work on Windows XP SP2/SP3 x86 / x64, Vista x86 / x64 and Windows 7 x86 / x64 in conjunction with Office 2007 and Office 2010 can really take quite a bit of time even with the help of Hyper-V snapshots to make sure that you aren't missing any edge cases. You have prereqs with prereqs such as VSTO -> .NET 4.0 -> Windows Imaging Components -> MSI 3.1 in the case of Windows XP SP2. Microsoft doesn't keep it simple but thankfully InstallShield does a good job trying to keep up.
Somethings have improved as Office 2010 once again behaves like Office 2003 in allowing you to register AddIns in HKEY_LOCAL_MACHINE ( the hell that is Office 2007 is fodder for another blog post ) but Office 2010 adds a whole new wrinkle that makes me want to pull my hair out: Bitness Pain
Let's start with the easy bitness pain: VSTOR40_x86.exe vs VSTOR40_x64.exe. The VSTO AddIn has a run time dependency that's tied to the platform of Windows that you are running on. Still, since the setup.exe bootstrapper is handling VSTOR for me, this is a pretty easy problem to solve.
Now for the harder pain: Your AnyCPU VSTO AddIn has to be registered in HKEY_LOCAL_MACHINE but which hive? The 64bit or the 32bit?
If you picked 64bit you are probably wrong. If you said "use registry reflection you re probably wrong also since this was removed from Windows 7 and considering how much of a flop Vista was your user is probably running Windows 7.
See, it doesn't matter that you are running 64bit Windows, it matters if you are running 64bit Office! Now for the kicker, Microsoft has a complicated work flow for recommending if a user should install the x86 Office or the x64 Office. It basically boils down to Developers and Hard Core Excel Junkies with spreadsheets larger then 2GB should run x64 and the rest of the world should run x86. In fact, if you stick the disk in and run the setup.exe from the root you are very likely to get x86 Office 2010.
So now you have this AnyCPU AddIn packaged up in MSI which doesn't officially support hybrid installs which means you have to have 2 downloads and hope your user is smart enough to know which one to download. Or you have to make 2 MSI's and wrap it with a bootstrapper .... something that InstallShield can't do at the moment.
Hmmm... what to do, what to do? I guess I could just punt and only support x86 Office. After all the vast vast majority of users will be using it. But Microsoft really wants to move the community forward and I really don't want to leave my customer taking even 1 support call trying to get their AddIn to work.
So I think I'm going to vote for a Hybrid install on this one. It's only 4 registry values that I need to write so I'm going to put my nose up in the air at Windows Installer and roll a custom action which fires only on 64 machines to write the values and remove them on uninstall.
If anyone at Microsoft is reading, and I know you are from my http logs, please, please try to do something to fix this. This single bitness limitation in MSI is just going to become more and more painful in my opinion.
PS- I'll probably never get back to the Office 2007 comment so here goes. 2007 only supported registering AddIns in HKEY_CURRENT_USER. There is a HotFix available along with a registry value to fix this and Microsoft blog articles say 'we fixed it' but here's the catch. We aren't allowed to redistribute it with our installers. We have to hope that end users have patched their machines via Microsoft Update. Well I didnt want my customer to have to get that support call either so I wrote an AppSearch that checks if Office12 MSO.DLL is present that it's atleast a certain version otherwise gate with a LaunchCondition.
Saturday, September 18, 2010
Friday, September 17, 2010
.NET 4.0 has 2 Global Assembly Cache (GAC)
Please be sure to read the following article and then come back. I'll pull up a chair and wait for you.
.NET 4.0 has 2 Global Assembly Cache (GAC)
Wow, I only recently noticed that .NET 4.0 has a "new GAC" ( BTW, wtf? I guess Global doesn't really mean Global? )
But I'm wondering, what does this mean to me as a Setup guy? Does the MSI support this? To find out I created a CLR 4 Class Library in Visual Studio 2010 and signed it with an SNK. I dropped it into an InstallShield Basic MSI targetting the GAC like normal and sure enough the file deployed to [WindowsFolder]Microsoft.NET\assembly\GAC_MSIL\ClassLibrary1\v4.0_1.0.0.0_token.
But, is there anything else I need to know here? My head is just spinning from this design decision ( although I seem to be in good company ) and I really want to make sure I understand all of the implications.
.NET 4.0 has 2 Global Assembly Cache (GAC)
Wow, I only recently noticed that .NET 4.0 has a "new GAC" ( BTW, wtf? I guess Global doesn't really mean Global? )
But I'm wondering, what does this mean to me as a Setup guy? Does the MSI support this? To find out I created a CLR 4 Class Library in Visual Studio 2010 and signed it with an SNK. I dropped it into an InstallShield Basic MSI targetting the GAC like normal and sure enough the file deployed to [WindowsFolder]Microsoft.NET\assembly\GAC_MSIL\ClassLibrary1\v4.0_1.0.0.0_token.
But, is there anything else I need to know here? My head is just spinning from this design decision ( although I seem to be in good company ) and I really want to make sure I understand all of the implications.
Wednesday, September 15, 2010
Read the Windows Installer SDK
I have a story that I'd like to share and I ask everyone to please not take it too seriously / literally. With that out of the way, here goes.
I was at church the other day and they were doing a presentation of Bibles to third graders. It was really exciting to see these little kids up there unwrapping their new found treasure.
At some point there was an oath where the children and later the adults promised to read their Bibles. During this a comment was made by the that you won't always understand what you are reading but that you should keep reading it until one day you do.
One of my responsibilities at work is team professional growth. I do all kinds of activities to keep everyone plugged in and learning but just like anything if life if you only listen for an hour a week you are never really going to get it.
So at the risk of sacrilege, I want to state:
Read your Windows Installer Bible!
Yes, it's a tough read that doesn't always make sense but read it every day anyways. Apply it to what you do every day and one day soon those obscure notes sprinkled throughout will make sense.
Whenever I get a really hard problem, I am usually able to solve it really quickly because I took the time to read it over and over. People sometimes look at me with amazement on how fast I fixed a problem but the truth is anyone who takes the time to learn it inside and out should be able to do it. It just goes to show me that they haven't been reading their MSI SDK.
Try to make a commitment to yourself. 30 minutes a day for the next month. You might be surprised what you learn.
I was at church the other day and they were doing a presentation of Bibles to third graders. It was really exciting to see these little kids up there unwrapping their new found treasure.
At some point there was an oath where the children and later the adults promised to read their Bibles. During this a comment was made by the that you won't always understand what you are reading but that you should keep reading it until one day you do.
One of my responsibilities at work is team professional growth. I do all kinds of activities to keep everyone plugged in and learning but just like anything if life if you only listen for an hour a week you are never really going to get it.
So at the risk of sacrilege, I want to state:
Read your Windows Installer Bible!
Yes, it's a tough read that doesn't always make sense but read it every day anyways. Apply it to what you do every day and one day soon those obscure notes sprinkled throughout will make sense.
Whenever I get a really hard problem, I am usually able to solve it really quickly because I took the time to read it over and over. People sometimes look at me with amazement on how fast I fixed a problem but the truth is anyone who takes the time to learn it inside and out should be able to do it. It just goes to show me that they haven't been reading their MSI SDK.
Try to make a commitment to yourself. 30 minutes a day for the next month. You might be surprised what you learn.
Saturday, September 11, 2010
In Defense of Merge Modules
Neil Sleightholm recently commented:
Let's begin by reviewing Windows Installer Tao Rule # 43
Now let's go back and re-read Rule #43 with a little emphasis on the parts that I find interesting:
However, I am certain that using merge modules internally to distribute setup development is a good thing. Comparable and even better in some situations then using WiX Fragments / Libraries / Binary Libraries or InstallShield Developer Installation Manifests.
First, Merge Modules are STANDARD and can be consumed by installers ranging from InstallShield to WiX. Try consuming an InstallShield DIM in WiX or a WiX Fragment in InstallShield.
Second, merge modules are atomic collections of components and setup logic. This is actually fairly similar to WiX Fragments which according to their own documentation are also atomic and immutable. WiX Binary Libraries and MSI Merge Modules both aim to solve similar problems.
Sure, using Fragments can speed up your build and give you a bit more flexibility ( like including two components in a fragment but Referencing them into two different features ). However, you can do the same thing with merge modules by creating multiple merge modules with module dependencies to describe component / feature relationships. With a little bit of creativity, Merge Modules can even be used to encapsulate AppSearches, CustomActions, Dialogs and more.
Over the last five years I've developed an architecture where I use an InstallShield Basic MSI project to describe a feature tree and product configurations to describe which features to consume. This serves as a fishbone that I then flesh out with dozens to hundreds of merge modules and create dozens of product installers with. I use Major Upgrades as my servicing strategy and the result is I've never had any problems that were caused by the use of Merge Modules.
In summary, you don't have to have a monolithic InstallShield project for each of the installs you own. You can split it out and reuse components and logic through merge modules and not increase the fragility of your install. In fact, you can realize considerable savings by eliminating wasted effort and decreasing the frequency of bugs in your baseline.
Yes, I will admit it: I use Merge Modules and I'm OK with that. Still, I will be working on Fragment support for IsWiX.
"Personally I never use merge modules unless I am forced to!"It's an interesting perspective and I invite Neil to tell more ( as an aside, I'm always interested in guest bloggers on the Deployment Engineering team. Diversity in Opinion is always a good thing ). Until then, I wanted to give a few of my thoughts.
Let's begin by reviewing Windows Installer Tao Rule # 43
Rule 43: Think carefully about Merge Module PatchingLet's begin with a little history lesson. Microsoft used to use Concurrent / Nested Installs and Merge Modules as a deployment option for Microsoft SQL Server Desktop Engine. Then along came some really nasty security vulnerabilities that exposed a glaring problem in servicing these products that were embedded in other products. Network / Systems Administrators simply couldn't patch there production systems easily to eliminate these worms. Then Microsoft started telling developers to not use these technologies and instead use Micro-Packages to deliver them. After awhile, the message mutated into something along the lines of "merge modules are evil". Then there was the little problem that MSI doesn't actually provide a decent bootstrapper / chainer to put all these packages together and the proliferation of packages has made Add/Remove Programs look like total chaos.
Merge modules provide a standard method for delivering Windows Installer components and setup logic just like any redistributable software. For all practical purposes any MSI package can consume a merge module and start using the functionality exposed by the merge module. However, the servicing story of such an MSI package has a huge flaw. Since the setup author who owns the MSI doesn’t own the merge module, they have no way to deliver fixes to issues that are found in the merge module, unless the merge module owner makes them available. On the other hand, the owner of the merge module has no way of delivering the fixes directly to the clients who installed the MSI built after consuming his/her merge module. The bottom-line of the story here is:
•Do not consume merge modules of vendors who do not promise to fix their merge modules promptly when bugs arrive
•Be prepared to handle the heat when bugs are found in your merge module causing issues for others’ products that have consumed your merge module and you get to put out the flame
Merge modules are great to use for distributing authoring and building of your setup. However, if you intend to redistribute an MSM externally, you should review the servicing implications. If you can tightly control the MSM consumers and identify the relevant products, then it’s possible to service them with a single MSP (multi-product targeting). Otherwise the recommendation is to provide your technology as an MSI that must be chained into the setup
Now let's go back and re-read Rule #43 with a little emphasis on the parts that I find interesting:
Rule 43: Think carefully about Merge Module PatchingOK, so what am I getting at? Yes, it's true that when I put merge modules in my installs from third parties ( typically Microsoft .. how ironic ) that the quality of my installs go down. And it's true that Microsoft doesn't promise to provide fixes and updates to these modules and in many instances they don't provide MicroPackages to redistribute either. So what's my alternative? Break the component rules and author my own components for another companies resources? Yup, this is an ugly problem that's never solved except by not taking dependencies on those components and moving to newer technologies that get more love from third party vendors. Still, I'm writing the install not the application so I don't typically get to make that call.
Merge modules provide a standard method for delivering Windows Installer components and setup logic just like any redistributable software. For all practical purposes any MSI package can consume a merge module and start using the functionality exposed by the merge module.However, the servicing story of such an MSI package has a huge flaw.Since the setup author who owns the MSI doesn’t own the merge module, they have no way to deliver fixes to issues that are found in the merge module, unless the merge module owner makes them available.On the other hand, the owner of the merge module has no way of delivering the fixes directly to the clients who installed the MSI built after consuming his/her merge module.The bottom-line of the story here is:
•Do not consume merge modules of vendors who do not promise to fix their merge modules promptly when bugs arrive
•Be prepared to handle the heat when bugs are found in your merge module causing issues for others’ products that have consumed your merge module and you get to put out the flame
Merge modules are great to use for distributing authoring and building of your setup. However, if you intend to redistribute an MSM externally, you should review the servicing implications. If you can tightly control the MSM consumers and identify the relevant products, then it’s possible to service them with a single MSP (multi-product targeting). Otherwise the recommendation is to provide your technology as an MSI that must be chained into the setup
However, I am certain that using merge modules internally to distribute setup development is a good thing. Comparable and even better in some situations then using WiX Fragments / Libraries / Binary Libraries or InstallShield Developer Installation Manifests.
First, Merge Modules are STANDARD and can be consumed by installers ranging from InstallShield to WiX. Try consuming an InstallShield DIM in WiX or a WiX Fragment in InstallShield.
Second, merge modules are atomic collections of components and setup logic. This is actually fairly similar to WiX Fragments which according to their own documentation are also atomic and immutable. WiX Binary Libraries and MSI Merge Modules both aim to solve similar problems.
Sure, using Fragments can speed up your build and give you a bit more flexibility ( like including two components in a fragment but Referencing them into two different features ). However, you can do the same thing with merge modules by creating multiple merge modules with module dependencies to describe component / feature relationships. With a little bit of creativity, Merge Modules can even be used to encapsulate AppSearches, CustomActions, Dialogs and more.
Over the last five years I've developed an architecture where I use an InstallShield Basic MSI project to describe a feature tree and product configurations to describe which features to consume. This serves as a fishbone that I then flesh out with dozens to hundreds of merge modules and create dozens of product installers with. I use Major Upgrades as my servicing strategy and the result is I've never had any problems that were caused by the use of Merge Modules.
In summary, you don't have to have a monolithic InstallShield project for each of the installs you own. You can split it out and reuse components and logic through merge modules and not increase the fragility of your install. In fact, you can realize considerable savings by eliminating wasted effort and decreasing the frequency of bugs in your baseline.
Yes, I will admit it: I use Merge Modules and I'm OK with that. Still, I will be working on Fragment support for IsWiX.
Friday, September 10, 2010
InstallShield KB Q207265 Critique
I was browsing InstallSite today when I noticed a link to InstallShield KB Q207265:
HOWTO: Implement an InstallScript Custom Action to Detect and Display Message About Whether a Directory Exists
I'm a little suprised by this article for several reasons. The first reason is that it suggests writing InstallScript custom actions for functionality that already exists in the Windows Installer. The AppSearch pattern ( InstallShield calls it System Search ) is more then capable of resolving if a directory exists by using the DrLocator table. Also you can easily create a modal dialog with a text control that displays exists / not exists messages based on the results of the first search.
Finally the article suggests scheduling the custom action in the execute sequence with a condition of REMOVE <> "ALL" to prevent execution during an uninstall. However, this means that the message will be displayed during a silent install since the CA is in the execute sequence and there is nothing that takes UILevel into consideration.
Overall I'm really surprised by the lack of quality in this article. I know InstallShield has some extremely talented and experienced experts such as Robert Dickau so I'm not sure where this article came from.
HOWTO: Implement an InstallScript Custom Action to Detect and Display Message About Whether a Directory Exists
I'm a little suprised by this article for several reasons. The first reason is that it suggests writing InstallScript custom actions for functionality that already exists in the Windows Installer. The AppSearch pattern ( InstallShield calls it System Search ) is more then capable of resolving if a directory exists by using the DrLocator table. Also you can easily create a modal dialog with a text control that displays exists / not exists messages based on the results of the first search.
Finally the article suggests scheduling the custom action in the execute sequence with a condition of REMOVE <> "ALL" to prevent execution during an uninstall. However, this means that the message will be displayed during a silent install since the CA is in the execute sequence and there is nothing that takes UILevel into consideration.
Overall I'm really surprised by the lack of quality in this article. I know InstallShield has some extremely talented and experienced experts such as Robert Dickau so I'm not sure where this article came from.
Friday, August 27, 2010
WiX-Users: Exceeding Version Limits
Sohail Somani recently asked on the WiX-Users List:
The tool ( let me guess: InstallShield ) Sohail used to use isn't the evil, it's how it was used that is incorrect. Over my many years of writing installs I've seen this situation happen over and over:
(I'll use one real world example to illustrate how absurd this really can get when you let functionals try to drive the decision without consulting technical resources. Seriously.... don't ask )
Release Manager: I need the product version to be DMLSS_V3.00.01.A.01.10
Setup Developer: I am sorry, I can only do x.x.x.x with certain upper and lower bounds for each field.
Release Manager: That's crazy, the install shouldn't dictate what I choose. You must make it what I say.
However, certain the release manager is about how things must be done to meet his 'special' business needs ( aren't they always? ), the MSI SDK is quite clear on the definition of the ProductVersion property:
Setup Developer: I'm sorry, I can display your custom version scheme on the dialog but I cannot possibly assign it to the ProductVersion.
Instead it looks like Sohail is just looking for a way around MSI to make the release manager happy. I understand that pressure but personally I never tolerate it. I suppose that's partly why I change jobs so often. Still, it can get better as evidenced by the fact that I've been at my current employer for nearly two years now when the last time I worked for them I barely made it past a year. Push back hard enough and provide sound reasoning and eventually it will improve.
I'm currently in the middle (or nearing the end, I hope) of porting an installer from the evil that shall not be named to WiX.
Mostly, it's been pretty easy. However, one thing which is sticking out is the version number. The products being ported use the current year as the major version number and this means strings like "2011.foo.bar".
...Is there a simpler way to exceed the limits...?
The tool ( let me guess: InstallShield ) Sohail used to use isn't the evil, it's how it was used that is incorrect. Over my many years of writing installs I've seen this situation happen over and over:
(I'll use one real world example to illustrate how absurd this really can get when you let functionals try to drive the decision without consulting technical resources. Seriously.... don't ask )
Release Manager: I need the product version to be DMLSS_V3.00.01.A.01.10
Setup Developer: I am sorry, I can only do x.x.x.x with certain upper and lower bounds for each field.
Release Manager: That's crazy, the install shouldn't dictate what I choose. You must make it what I say.
However, certain the release manager is about how things must be done to meet his 'special' business needs ( aren't they always? ), the MSI SDK is quite clear on the definition of the ProductVersion property:
The format of the string is as follows:The old tool allowed this violation ( usually without much real life harm, perhaps some problems doing Major Upgrades ) but WiX simply doesn't allow it. I think that's a good thing because it helps the install developer when he needs to tell management:
major.minor.build
The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255. The third field is called the build version or the update version and has a maximum value of 65,535.
Setup Developer: I'm sorry, I can display your custom version scheme on the dialog but I cannot possibly assign it to the ProductVersion.
Instead it looks like Sohail is just looking for a way around MSI to make the release manager happy. I understand that pressure but personally I never tolerate it. I suppose that's partly why I change jobs so often. Still, it can get better as evidenced by the fact that I've been at my current employer for nearly two years now when the last time I worked for them I barely made it past a year. Push back hard enough and provide sound reasoning and eventually it will improve.
Tuesday, August 24, 2010
IsWiX Stretch Goals
Wilbert van Dolleweerd left a comment on the blog entry IsWiX - Three Great Tastes asking:
IsWiX is already a very usable tool at my day job as it was designed for our specific needs. However, I'd love to grow it into general purpose tool. With that in mind, here is a short list of stretch goals I have for IsWiX. I am also very open minded to feedback to see where people would like to see this project go.
User Documentation
I had written a user manual for IsWiX but it used a company confidential template so I left it behind.
Presentation
I'd like to develop a one hour overview of Windows Installer / WiX technologies targeted at traditional developers for use at CodeCamp and DotNet User Group type events. I am somewhat concerned that there might not be much interest in this from developers.
Robust Automation Interface
SDK Documentation and Visual Studio Project Templates to help people write designers and domain objects for Fireworks / IsWiX.
Support for Sharp Develop
Matt Ward was very helpful in coaching me in the use of their XmlEditor control and I know they are WiX fans so I'd like to try to give something back. Combining SharpDevelop, WiX and IsWiX seems like a no brainer for small companies and developing markets who can't afford Visual Studio / InstallShield.
Improvements to the XML Editor
IsWiX is meant to be used with Votive which already has a decent XML editor. The XML editor in IsWiX was initially implemented primarily as a way to preview the changes to the in memory document but it would be nice to mature it to a point of being similar in capabilities of Visual Studio but a lot lighter weight.
VIM Text Editor
OK, this is somewhat a gag feature ( but I'm actually serious here ) but it would be interesting to somehow host VIM in a Winforms control. Imagine switching from designer mode to editor mode and using all the VIM tricks you are used to and then switching back to designer mode.
Refactor Files and Folders
I need to clean this up to use proper domain objects and allow it to exist in Product's, Fragments or Modules. It currently only supports Modules since that was the easiest path to supporting our use case.
COM Extraction
Add the ability for the Files and Folders designer to interact with Heat to perform COM harvesting and authoring. Currently I use a utility that serves as a front end to heat to author the COM snippets and then manually integrate them using the text editor.
Additional Designers
Finish work on Custom Tables Schema Editor and implement Services, Registry and ShortCuts Designers
We are in the process of migrating away from Installshield to Wix. It is a good tool if you don't mind a bit of commandline work (for the record: I'm a VIM user ;-)
Would love to see your ideas for IsWix and how you're willing to enhance it. I might even consider contributing to it.
IsWiX is already a very usable tool at my day job as it was designed for our specific needs. However, I'd love to grow it into general purpose tool. With that in mind, here is a short list of stretch goals I have for IsWiX. I am also very open minded to feedback to see where people would like to see this project go.
User Documentation
I had written a user manual for IsWiX but it used a company confidential template so I left it behind.
Presentation
I'd like to develop a one hour overview of Windows Installer / WiX technologies targeted at traditional developers for use at CodeCamp and DotNet User Group type events. I am somewhat concerned that there might not be much interest in this from developers.
Robust Automation Interface
SDK Documentation and Visual Studio Project Templates to help people write designers and domain objects for Fireworks / IsWiX.
Support for Sharp Develop
Matt Ward was very helpful in coaching me in the use of their XmlEditor control and I know they are WiX fans so I'd like to try to give something back. Combining SharpDevelop, WiX and IsWiX seems like a no brainer for small companies and developing markets who can't afford Visual Studio / InstallShield.
Improvements to the XML Editor
IsWiX is meant to be used with Votive which already has a decent XML editor. The XML editor in IsWiX was initially implemented primarily as a way to preview the changes to the in memory document but it would be nice to mature it to a point of being similar in capabilities of Visual Studio but a lot lighter weight.
VIM Text Editor
OK, this is somewhat a gag feature ( but I'm actually serious here ) but it would be interesting to somehow host VIM in a Winforms control. Imagine switching from designer mode to editor mode and using all the VIM tricks you are used to and then switching back to designer mode.
Refactor Files and Folders
I need to clean this up to use proper domain objects and allow it to exist in Product's, Fragments or Modules. It currently only supports Modules since that was the easiest path to supporting our use case.
COM Extraction
Add the ability for the Files and Folders designer to interact with Heat to perform COM harvesting and authoring. Currently I use a utility that serves as a front end to heat to author the COM snippets and then manually integrate them using the text editor.
Additional Designers
Finish work on Custom Tables Schema Editor and implement Services, Registry and ShortCuts Designers
Subscribe to:
Posts (Atom)