How to run EXE file from bundle as Administrator -

2020-04-21 01:22发布

问题:

I have bundled all my two .msi using Wix bootstraper application into single EXE file.

One msi is with per user context which uninstall a application with per user context and install own.

second one is with per machine context and this also installs the files in windows drive.I have bundled both MSI as single EXE.

Now if i open the EXE as Run as Administrator,the EXE is uninstalling the per user package and installation happens successfully. If i directly double click the EXE package, during the removal of per user package i am getting the following exception "Error 1001.An exception occured during uninstalling....->Requested registry access is not allowed". and installation failed.

I tried adding a manifest file in BA to include in to EXE package to prompt the administrator privilege during double click. After doing this and building in VS2010, all other two package are not included in EXE file and if i double click the EXE it is showing the UAC and close without installing.

Is it possible to catch the installer exception from WIX and show a message like "Please right click and run as administrator" to user.

Please help me to solve this.

Thanks