Go Back   PackageDeploy Application Packaging Forums > Package Development > Application Packaging > Platformsdk MSI

Reply
 
LinkBack Thread Tools Display Modes
Old 05-03-2010, 04:01 PM   #1 (permalink)
Wilhelm Noeker
Guest
 
Posts: n/a
Default "Just Me" considered harmful

Hello everyone,

I'm using VS2005 to generate the MSI package for my software. Only
recently I became aware that the "Everyone"/"Just Me" option, which the
resulting setup displays by default, is not what I wan. (It messes up
the "RemovePreviousVersions" feature. For example, install v1.1 for
"just me", then install v1.2 for "everyone", and you have both versions
installed - well, sort of.)

It is clear what I should have done from the start: Always install for
everyone. (Which in VS2005 only requires to set InstallAllUsers as True
and, on the installation folder page, InstallAllUsersVisible as False.)
Since my software includes a service, installing it for individual users
makes little sense anyway.

However, with several versions of my software already released, I'm
reluctant to change this behaviour now. It would be an improvement in
the long run, but for those users who until now have always clicked
"just me", it would be guaranteed to cause a lot of confusion.

So here's my question: When doing an installation for everyone, is there
a way to detect a previous version installed for an individual user, and
at least display a warning message?

(My first idea would be to place such a check in my custom action setup
program. Like "the service I'm about to install has already been
installed, so RemovePreviousVersions obviously did not work as
intended". But perhaps there is a more elegant, Installer-based solution?)

Thanks
Wilhelm
  Reply With Quote
Old 05-03-2010, 05:01 PM   #2 (permalink)
Richard [Microsoft Windows Installer MVP]
Guest
 
Posts: n/a
Default Re: "Just Me" considered harmful

[Please do not mail me a copy of your followup]

Wilhelm Noeker <wnoeker@t-online.de> spake the secret code
<eLmZpYt6KHA.5112@TK2MSFTNGP02.phx.gbl> thusly:

>So here's my question: When doing an installation for everyone, is there
>a way to detect a previous version installed for an individual user, and
>at least display a warning message?


Yes, I've had to deal with this situation before and it can be
detected. I believe you have to use the MSI API to see if your
product is already installed. The API will also tell you if its
installed per-user or per-machine. I don't recall the exact function
off the top of my head, but if you can't find it ping back here and
I'll dig around for it.

Unfortunately you can't integrate this step into the setup project
type provided by Visual Studio, because it doesn't allow you to
sequence your custom action at the right time. Basically you need an
immediate CA that sets a property that is used in a launch condition.
Visual Studio setup projects only let you create deferred custom
actions that run at a later time in the installation process.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

Legalize Adulthood! <http://legalizeadulthood.wordpress.com>
  Reply With Quote
Old 05-05-2010, 02:01 PM   #3 (permalink)
Wilhelm Noeker
Guest
 
Posts: n/a
Default Re: "Just Me" considered harmful

Richard [Microsoft Windows Installer MVP] wrote:

> Wilhelm Noeker <wnoeker@t-online.de> spake the secret code
> <eLmZpYt6KHA.5112@TK2MSFTNGP02.phx.gbl> thusly:
>
>> So here's my question: When doing an installation for everyone, is there
>> a way to detect a previous version installed for an individual user, and
>> at least display a warning message?

>
> Yes, I've had to deal with this situation before and it can be
> detected. I believe you have to use the MSI API to see if your
> product is already installed. The API will also tell you if its
> installed per-user or per-machine. I don't recall the exact function
> off the top of my head, but if you can't find it ping back here and
> I'll dig around for it.


Thanks for pointing me in the right direction, I've got it all solved
now. I have a launch condition that tests for "Not PER_USER_INSTALLED",
and that property is created by the following VBScript CustomAction:

--8<--
myUpgradeCode = "{12345678-ABCD-1234-5678-112233445566}"
Set products = Session.Installer.RelatedProducts( myUpgradeCode )
For Each product In products
astp = CLng( Session.Installer.ProductInfo(product, "AssignmentType") )
If astp = 0 Then
Session.Property( "PER_USER_INSTALLED" ) = "Y"
End If
Next
-->8--

> Unfortunately you can't integrate this step into the setup project
> type provided by Visual Studio, because it doesn't allow you to
> sequence your custom action at the right time. Basically you need an
> immediate CA that sets a property that is used in a launch condition.
> Visual Studio setup projects only let you create deferred custom
> actions that run at a later time in the installation process.


I know, I've run into that kind of problem before. But I've also grown
used to applying script-based patches to the MSIs created by Visual
Studio. And "all I had to do" this time was:
- change the CustomAction type for my script from 1030 to 6
- change the sequence number for my custom action, so that it runs ahead
of LaunchConditions
- duplicate that table row from InstallExecuteSequence to the
InstallUiSequence table
  Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:49 PM.


vBulletin, Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
2007 - 2012 PackageDeploy.com