Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Forbid upgrade from New version to Old version

Hello AI team,

1. Please give me some clue. Why does my installer allows installation of Old product, when New one is already installed?

2. Not related question. I have Installer which installs per-machine if user is administrator and per-user otherwise. And it is possible to install both types in parallel. I.e. I can install msi version 1.0 for current user and then install version 2.0 for local machine. But i cannot install version 1.0 both for current and local machine. Is it possible to override this behavior, and allow "parallel" installation of the same version per-user and per-machine?

Best regards,
Andrey Bocharnikov
Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Forbid upgrade from New version to Old version

Hi Andrey,
1. Please give me some clue. Why does my installer allows installation of Old product, when New one is already installed?
When trying to install same installation package with a lower version you will be prompted by the Windows Installer with the following error:
A more recent version of your application is already installed on this computer
Since you are using the Per-machine if user is administrator, per-user otherwise option for the installation type, you may get this behaviour when installing Per-User first time and then you try to install a lower version. By default, a Per-machine installation type is selected and this is why you are allowed to install a lower version.

Please keep in mind that a per-user installation cannot upgrade a per-machine installation and a per-machine installation cannot upgrade a per-user installation. Please take a look on the Different Installation Type article which may be useful to you.
2. Not related question. I have Installer which installs per-machine if user is administrator and per-user otherwise. And it is possible to install both types in parallel. I.e. I can install msi version 1.0 for current user and then install version 2.0 for local machine. But i cannot install version 1.0 both for current and local machine. Is it possible to override this behavior, and allow "parallel" installation of the same version per-user and per-machine?
Since it is a Per-Machine installation, why would you need a Per-User installation? Can you please give me more details about your scenario?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Forbid upgrade from New version to Old version

Hello Dan,

1. Indeed if I install Per-machine version 2.0.0 then run 1.0.0 it fails to run as expected.
By default, a Per-machine installation type is selected and this is why you are allowed to install a lower version.
1,2:
Can you please give me more details about your scenario?
My goal is to allow users to have completly separate Per-User and Per-Machine installations. The desired behaviour is:
  • It is always possible to launch the installer no mater if newer Per-User or Per-Machine version is already installed.
  • Perform versions check only after user selects instsallation type in Installation Type Dialog and presses Next. And fail installation only if existing_version (for selected installation type) >= current.
  • If user run the Installer silently, it should be possible to calculate installation type by ALLUSER and MSIINSTALLPERUSER properties from commandline. And then check that existing version have to be older than is currently installing one.
This is important because there could be several user on the terminal server. And there could be one Per-Machine installation and several Per-User installations. And all this installations should be independent.

Bad scenario which I wish to avoid:
There are 3 installations: UserA, UserB, Machine.
  • UserA, UserB both install per-user version 1.0.0.
  • Then Per-Machine version 2.0.0 is installed.
  • UserA and UserB both want to work with some actual data which requies version 2.0.0. But they are not allowed to install 2.0.0 Per-user.
    They don't want to work with Per-Machine version for some reason (I will skip irrelevant details).
How can I implement such behaviour?

Best regards,
Andrey
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Forbid upgrade from New version to Old version

Hi,
May be the problem description above is too complex and I should find more simple example?

Best regards,
Andrey
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Forbid upgrade from New version to Old version

Hello Andrey,

I apologize for such a delayed answer. I'm not sure how, but it seems your latest post was somehow overlooked.
It is always possible to launch the installer no mater if newer Per-User or Per-Machine version is already installed.
Perform versions check only after user selects instsallation type in Installation Type Dialog and presses Next. And fail installation only if existing_version (for selected installation type) >= current.
I'm afraid this is not possible.
If user run the Installer silently, it should be possible to calculate installation type by ALLUSER and MSIINSTALLPERUSER properties from commandline. And then check that existing version have to be older than is currently installing one.
This can be done by manually setting the ALLUSERS and MSIINSTALLPERUSER properties accordingly from command line.
Bad scenario which I wish to avoid:
There are 3 installations: UserA, UserB, Machine.
UserA, UserB both install per-user version 1.0.0.
Then Per-Machine version 2.0.0 is installed.
UserA and UserB both want to work with some actual data which requies version 2.0.0. But they are not allowed to install 2.0.0 Per-user.
They don't want to work with Per-Machine version for some reason (I will skip irrelevant details).
Unfortunately, this cannot be done.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Forbid upgrade from New version to Old version

Hi, Dan,
Thanks for your reply!
Thats very confusing limitation of Windows Installer.

Best regards,
Andrey.

Return to “Common Problems”