1

I have created the installer exe file using BA using wix.I want to force the user to open the exe as RUN as Administrator.To do this,I want to show a MessageBox with OK button to user if user double-click or right click and hit->Open.On clicking OK button on MessageBox should Exit the installation.I don't want to open the installer until the user open the file as Run as Administrator.

I want to know

1.Is the above behaviour is possible in wix using custom action or something.

2.Is it possible to detect exe double-click and right-click->Open in c#.

Update:

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 Post Build of 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 any way there to include the two msi and manifest file in bundle.wxs

Thanks

user3100575
  • 153
  • 2
  • 2
  • 7
  • The duplicate might not actually fit what you are asking, but it is definitely what you need (this is called the [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)). If you disagree, please let me know what you need and I will be happy to reopen. – Patrick Hofman Nov 30 '14 at 13:39
  • @PatrickHofman That answer i already reviewed and that does not solve my problem.I have bundled 2 msi to EXE using BA.1 msi is with peruser context and this remove existing product with peruser context.Another is per machine context and when the installer is opened by double click,during removal process the exe installation failed with error "Error 1001 Registry access denied".BTW if i run the installer as Administrator all process happening smoothly.I tried a lot to open the installer as administrator on double-click with no luck.So i am trying the above way in question.Plz help me solving. – user3100575 Nov 30 '14 at 14:08
  • You can't detect if the exe is opened using right click or such, unless you write Windows hooks, which is unreliable in this case. So to make you clear, you want to open an EXE as administrator as part of your installation? Please clarify your question so it tells what you really want to achieve. – Patrick Hofman Nov 30 '14 at 14:10
  • @PatrickHofman I have updated my actual requirement.Please see my "Update". – user3100575 Nov 30 '14 at 14:30
  • I reopened your post, since I can't judge if there is a valid duplicate for this question any more. I would consider to remove or rewrite your first part, since it makes no sense at all. – Patrick Hofman Nov 30 '14 at 14:33

0 Answers0