|
|
#1 (permalink) |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 (permalink) |
|
Guest
Posts: n/a
|
[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> |
|
|
|
#3 (permalink) |
|
Guest
Posts: n/a
|
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 |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|