Ryan Rivest

  Home :: Contact :: Syndication  :: Login
  8 Posts :: 0 Stories :: 10 Comments :: 0 Trackbacks

Archives

Post Categories

Saturday, September 12, 2009 #

This tip applies to Visual Studio 2008 and Windows Installer (Setup) Projects.  They’re used to create *.msi installers for deploying applications.

I was having some weird issues with my setup project.  When I tested the installer against the previous version of the installer, it would run fine without reporting any errors, but when I launched my application, the changes I made weren’t showing up. 

Odd, I thought.  I figured the installer wasn’t working properly.  What I was expecting was an uninstall to show up before the install ran.  This is actually the behavior in Visual Studio 2005 setup projects.  It’s different in Visual Studio 2008.

Problem

I incremented my setup project’s Version from 1.0.0 to 1.0.1, thinking this was good enough for the installer to upgrade a previous installer and grab the new application files.

If you investigate further, it will become apparent that the installer did indeed run.  You’ll also discover that none of the application’s assemblies or other files have been updated after running the installer.

As I briefly alluded to above, you apparently wouldn’t have this problem in Visual Studio 2005 due to the behavior of the legacy installers.  They actually do run an uninstall on the old installer, and install the new version.  Visual Studio 2008 behaves differently.

Solution

There are two important steps to get the installer upgrades working properly in Visual Studio 2008. 

  1. Increment the Deployment Project's Version

    For example, if your current version is 1.0.0, change it to 1.0.1

  2. Increment the file versions

    [assembly: AssemblyVersion("1.0.0.1")] [assembly: AssemblyFileVersion("1.0.0.1")]

In Visual Studio 2008, a file version comparison occurs when the new installer runs against an older installer, replacing anything that has changed rather than running an uninstall/reinstall.  Overall it’s much nicer for upgrades, but confusing if you don’t know what’s happening and forget to change the file versions like I did.

General Rules About Installer Upgrades in Visual Studio 2008

  1. Old and new products must have identical UpgradeCode values and different ProductCode values.

  2. Old and new products must have identical values for InstallAllUsers.

  3. New product's setup Version (the setup project, nothing to do with file versions) must be higher.

  4. All setup versions (again, not file versions) must be 1.0 or greater.

  5. Visual Studio 2008 RemovePreviousVersions is not the same as 2005 and uses file update rules. Therefore if you want to update files you must increase file versions. This is normal practice in all setups, patches, etc. that file versions are updated if they have new content.

  6. Visual Studio 2005 RemovePreviousVersions behaves like an uninstall of the older one, followed by an install of the new one, and rules 1-4 still need following, but you could get away with not incrementing changed file versions because of the "uninstall, then install" nature of the upgrade.

Thanks go out to Phil Wilson for the information!

Hope this helps someone else


I’m sure many of you have seen this arcade game in a local mall or arcade..

This is the face of pure evil.

stacker

It’s called Stacker.  The object of the game is to stack blocks on top of each other.. it’s simple.. but deceptively so.  You start with 3-block lines, and as you go up it’s sliced down to 2-block lines, and finally down to 1-block lines..

It’s so addictive, and here’s why.. these Stacker machines are prize vending games.  Usually they’ll have some great prizes like an Xbox 360, Wii, or other high ticket items.  Who wouldn’t want a $300 piece of hardware for $1?  Sweet deal right?

And that’s where they suck you in.

You see.. the game is so easy.  You think you’re going to win.. no, you KNOW you’re going to win.  Just one more dollar.. and on and on.  I spent about $10 on this game and noticed something:  Stacker is rigged.

Yep, you heard me.  The last 4 lines in this game are rigged.  After you pass up the “minor prize” to continue playing for a “major prize,” the lines will randomly skip a block.  It’s very discreet, but you can catch it if you watch closely.  This YouTube video illustrates this behavior clearly, and you will also see it happen if you play a few times past the minor prize.  It’s so addictive though.  The game makes you think that you’re going to win because it’s so simple, but the fact of the matter is that it’s based more on luck than skill.

The game is set up so that the owners can set the win ratio.  What this means is that you’ll never win unless you win by chance.

They can even set the speed at which the block lines move.  Some Stacker games are MUCH faster than others.  And it’s all regulated by the owners.

Want to learn more about these games?  They’re made by LAI Games International.  A “standard” Stacker (pictured above) sells for about $5,500.  Estimating the amount of dollars that go into these things before they spit out a prize, I’m guessing they earn much more than the initial cost and prize payouts.

If you want to win on these machines, I recommend not spending more than a few bucks, because you might get lucky and hit when it’s spitting out prizes.  Otherwise, you’ll just be wasting $$ on a game that is impossible to win.

If you’re still curious, check out this video on How to Win at Stacker.

Also, if you’re a fan of the gameplay (or want to practice), there’s a flash game called Bildy Blocks that is exactly the same.