Page 1 of 1

Still cannot update service already installed

Posted: Sat Jan 13, 2007 10:24 pm
by mannaggia
I'm evaluating IA and I had another thread about updating a service - I still cannot get it work - I'm about ready to give up.

My installer installs as service using Install Service. That works.

But I want to be able to release updated versions in the future, but not have a separate installer for a patch. I want users to be able to use the same installer for both new installs and update installs.

I have tried several things - simply pointing the Install Service command to the new file and rebuild - no luck. It does not touch the older file.

I tried using Control Service to stop the service on install, then use Install Files and/or Install service. No luck.

I tried adding a section after it does Apply Install, with just an Install Service command and another Apply Install - no luck.

In fact, if I stop the service and delete the service executable and re-run the installer (after rebuilding so the key changes) it doesn't even install the now missing file.

I used /l to create a log from an original install vs. an "update" install and I saw that in the "update" install, it has this line:

Code: Select all

Using cached product context: machine assigned for product <hex>


After that, it has some "Executing op:" lines, but not nearly as many as the log from the original install.

I don't know a lot about the inner workings of MSI, but it looks to me like it is thinking that the product is already installed and doesn't go through the install again, even though I have rebuild the installer which generates a new key - I assume that is a different key than what this is looking at.

If that is the cause, how do I get it to ignore the "cached product context" and reinstall the files?

Posted: Sun Jan 14, 2007 1:36 pm
by MichaelNesmith
Are you using a new revision code in your new setups?

Posted: Sun Jan 14, 2007 4:35 pm
by mannaggia
Yes, if I am thinking of the same think you are talking about. There is an option that generates that new code each time you rebuild the installer, and that option is checked.

So when I run the second install (the "update"), it runs as if it were a "new" install - that is, it does not come up with the Modify/Repair/Remove dialog.

I am also changing the version number in the .exe file (which shows on the Version tab when looking at the properties of the .exe file in Windows Explorer).

Posted: Sun Jan 14, 2007 4:39 pm
by mannaggia
As an aside, I created a new blank install script with 3 lines - I set $TARGETDIR, execute an Install Service (installing the updated file), then the Apply Changes command.

When I run this, it *does* update the service executable.

Putting these same commands at the end of the original installer and rebuilding and running it does *not* update the service executable.

Like I said before, it looks like it is seeing some "key" or "ID" somewhere that says "this product is already installed" and just skips everything in the installer.