IIS App Pool and .NET Framework version

by BuildGeek on April 19, 2011

in InstallShield

InstallShield allows for an easy way to create Application Pools using the Internet Information Service under Server Configuration in the Installation Designer view (at least easily for IIS6.0 and later which is all I’m concerned about in this post).  As you can see in the image below, .NET FW v2.0 is set by default. (click for full size)

What IS doesn’t allow, is for you to set the .NET Framework version for the App Pool to use.  If you’ve created a web site or sample application that was built against a specific version of the .NET Framework (lets say 4.0 for my scenario), then you’ll need to change the App Pool .NET FW version or it will not run out of the box.  Since Happy Installs = Happy(ER) Customers, we want things to work out of the box.

I needed this to work for IIS6 & IIS7.  I decided to just quickly create a custom action for each (actually leveraging a current CA from a previous buildmaster to give credit where it’s due).

First create an Application Pool. Installation Designer View -> Server Configuration -> Internet Information Services -> Application Pools.  Right click Application Pools and select Add Application Pool.

Now we will create two custom actions. One for IIS6 & one for IIS7.  Go to Behavior and Logic -> Custom Actions and Sequences then right-click Custom Actions at the top and create a New EXE CA.

Now you’ll want to fill out your information on the right. Your working directory will be the SystemFolder since the AppCmd.exe resides there for IIS7.

Filename & Command line: [SystemFolder]\inetsrv\appcmd.exe set Apppool /apppool.name:{MyAppPoolName} /enable32BitAppOnWin64:false /ManagedPipelineMode:Classic /managedRuntimeVersion:v4.0

Remember to replace with your application pool name. Also, you’ll want to set your enable32BitAppOnWin64 value for your version of windows you are targeting.

I made my Install Exec Sequence to be “After InstallFinalize” and set my Install Exec Condition to “&Samples_ASP.NET_IISConfig = 3 AND (IIS_VERSION <> “”) AND (IIS_VERSION <> 0)”.   These of course will depend on your installation and what variables you have set up.

Some more details for IIS7 and the command line I used. It’s quite simple since it can use the AppCmd.exe command line application to easily change the version of .NET Framework.

appcmd set apppool /apppool.name: {MyAppPoolName} /managedRuntimeVersion:v4.0

(src: http://technet.microsoft.com/en-us/library/cc754523(WS.10).aspx)

Replace {MyAppPooName} with the name of your Application Pool that is being installed, or already on the users machine that you need to modify.

For IIS6, I added another Custom Action using VBScript (no lectures here, it was quick and simple).  I also placed this one after my previous custom action in my Install Exec Sequence.

Click over to the script Tab and use the following:

Option Explicit
On Error Resume Next
Dim IIsObjectSet
IIsObject = GetObject(“IIS://LocalHost/W3SVC/AppPools/{MyAppPooName}”)
IIsObject.Put “ManagedPipelineMode”, 1
IIsObject.Setinfo
IIsObject.Put “managedRuntimeVersion”, “v4.0″
IIsObject.Setinfo
IIsObject.Put “Enable32BitAppOnWin64″, CBool(“False”)
IIsObject.Setinfo

Again, make sure you are replacing the {MyAppPoolName} with your application pool name.

That’s it!  Happy installing.

 

{ 0 comments }

Master Installer Easy Shortcut

by BuildGeek on March 15, 2011

in InstallShield,tips

If you have an IS master installer, you’re very aware of the many headaches you run into on a daily basis.  One that has been a particular bugger is adding shortcuts via the IS IDE. When you have tens of thousands of files (approaching hundreds of thousands of files), and attempt to add a shortcut via right-click “New Shortcut”, you could be waiting up to 20 mins from my experience (and my hardware doesn’t suck).

During this process, IS is loading every file from your projects File database into memory.  Then, if you have a project like me, you have to do that 10-50 more times for the new project you are adding to your master installer.  This can quickly become an extremely tedious multi-day, shoot-myself-in-the-head, project. So what’s the easiest way around? Here are a list of steps I follow to quickly add in shortcuts to an installer already bursting at the seams:

  1. Navigate to System Configuration\Shortcuts
  2. Add the folder structure you want your shortcuts to fall under (make note of the ‘Key Name’ of the folder(s) you want your shortcut(s) to fall under).  e.g.: newfolder591 in the example below
  3. Navigate to Additional Tools\Direct Editor in your IS IDE
  4. Scroll down until you get to the Shortcut table
  5. In my case, I can simply copy another similar shortcut (right-click ‘Copy Row’ the right-click ‘Paste Row’ ) from a previous component and modify it. You may need to create a new shortcut from scratch by clicking the “click here…” text on the last line of the Shortcut table.
  6. Make sure you update the Directory_ column to the Key Name from step 2.
  7. Save and switch back to ‘System Configuration\Shortcuts’ to see your hard work cut down.

{ 2 comments }

Track installed files

February 17, 2011

Nick from buildmaestro mentioned the other day he was looking for a tool to track all installer changes to a system.  I tweeted a tool I’ve used in the past called Advanced Uninstaller Pro his way. It has an monitor program that logs all files. Christopher Painter jumped in and reminded me of a tool I’d [...]

Read the full article →