问题
I'm working on a perplexing uninstall/install issue and I've exhausted my google-foo so I'm coming here hopeful that someone can point me in the right direction.
The scenario: We are using AnthillPro to do nightly builds/deployments of a legacy ASP website (built in VS2003) to Windows Server 2003 (x64 SP2) web servers and for the most part it works fine. The AnthillPro account uses the product code to uninstall the previous night's update package and then installs the new one using the name of the MSI.
Example:msiexec /qb /x {89B05BA3-679C-4120-BD6A-339BC3E726FD}
msiexec /qb /i "Update package.msi" PARAMETERVAL=X
This works just fine on our QA and Production web servers, but the dev server always gives us the error:The installation source for this product is not available. Verify that the source exists and that you can access it.
The most interesting detail about this is that when the AnthillPro account installs it, I cannot see the update in the Add/Remove Programs widget. I originally discovered this issue a few weeks ago and thought I fixed it by manually adding the ALLUSERS property to the MSI and setting it to 2. Again, this is a Visual Studio 2003 solution, so I can't just set the All Users property through the interface.
I am able to see the latest update on QA and Prod, however, so it seems to be something special with the dev box. I've confirmed that the resulting MSI does indeed have the ALLUSERS property, and I've tried playing with setting it to 1 instead of 2 (per this discussion).
The MSI is being overwritten with each build, so it is true that the original MSI is not sticking around in the directory the install is being executed from, but if I simply try redeploying what is already there, it still fails.
If I log in to the dev web server and install it myself, making sure that the All Users option is selected in the UI, it exhibits the same behavior if I try another automated deployment. If I ensure that the update is not installed on the box and kick off an automated deployment, it will succeed (after kicking out a warning about the uninstall not being able to uninstall anything), but will then fail with the "source is not available" error if I try another automated deployment after that.
The permissions on the folder containing the MSI and the MSI itself appear to be identical between dev, QA, and Prod. I do not have the password for the account that AnthillPro uses unfortunately (hooray for corporate security), but I at least do have access to someone who does and is willing to check on things if I am so inclined. I did confirm using this method that when I install the latest version of the update that the AnthillPro account can see it.
Does anyone have any ideas on what could be causing this issue?
After a few years of utilizing this site heavily, I am finally breaking down and posting my first question, so please be gentle if this scenario appears confusing or convoluted. I can provide more details if necessary.
回答1:
I'll just answer this for reference: setting the ALLUSERS property to 2 must have installed the MSI per user instead of per machine. Then only the user installing the product will see it in add / remove programs.
If you see the documentation for ALLUSERS you will see that ALLUSERS = 1 is the normal approach to force a per-machine installation. The documentation states: "...the value ALLUSERS=2 enables the system to reset the value of ALLUSERS, and the installation context, dependent upon the user's privileges and the version of Windows". In other words msiexec has installed by user because of lacking install account priviledges.. This behavior may be different on different operating systems.
It is possible to change to a per-machine install state via a custom action setting ALLUSERS = 1 after the RemoveExistingProducts action has run before InstallInitialize in a major upgrade. This is rather involved to test, but it is possible if you run the install with the same account that previously installed per-user, only now with administrative rights.
回答2:
I finally fixed this by simply uninstalling all versions of the web app and then manually going through the registry and removing any and all references to the web app's name, upgrade code and the various product codes for each version.
A lot of stress, but I finally figured it out. Leaving this here to maybe remind someone else in the future that the registry is always your enemy.
来源:https://stackoverflow.com/questions/10249747/uninstall-with-product-code-fails-installation-source-not-available