I have an installer that checks that the .NET 2.0 runtime is installed like
this (the Property element is a child of the Product element):

  <Property Id="DOTNET20INSTALLED">
   <DirectorySearch Id="DotNetFrameworkFolder"
Path="[WindowsFolder]Microsoft.NET\Framework" Depth="1">
    <FileSearch Id="DotNetSystemDLL" LongName="System.dll" MinVersion="
2.0.50727.1" MaxVersion="2.0.65535.65535" />
   </DirectorySearch>
  </Property>
  <Condition Message="This installation requires .NET Framework 2.0 runtime.
Please install it before running this
install.">DOTNET20INSTALLED</Condition>

This works fine in XP, and in Vista I get the UAC dialog and then it works
fine in elevated mode.  However, the MSI detects if the product is installed
and gives the user a "Remove" option if the product is installed.  If the
user selects to remove the product, then I do not get the UAC dialog
and I get the error message defined above, indicating that it could not find
the system.dll file.

I'm guessing the problem is related to the fact that I'm looking in the
[WindowsFolder] location, which requires elevated privileges.  This is
confirmed by the fact that if I run the installer via "msiexec /i" from a
command prompt that is running in elevated mode, it works.

So, I need to know one of two things:

1) How can I get the installer to be built so that it will always give the
UAC dialog so that it will run in elevated mode?  This question is the same
one that was posted in
http://www.winforumz.com/vista/Elevated-privileges-MSI-Package-Vista-ftopict13735.html,
but requiring that the installer be run from the command line is a not an
acceptable solution for me.

2) Or, what is the correct way to check for the existence of a file in the
C:\Windows folder in Vista? It seems strange that it works when installing,
but not when uninstalling.

Additional notes:

There is a lot of stuff online regarding problems running Custom Actions,
but this is not a custom action.  Also, I found something that says that if
the Custom Action is run in the UI sequence it won't work.  They should be
run in the Execute sequence.  Is my Property being evaluated during the UI
sequence when uninstalling, but in the execute sequence when installing?
How can I control that?
The uninstall works when right clicking the msi and selecting "Uninstall",
or uninstalling via the Control Panel, and (as noted above) when running
msiexec from an elevated command line.  It only doesn't work when running
the msi and selecting the "Remove" option.

Thanks,
Mike
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to