-1

I have an application which needs many prerequisites. For installing this application and install all prerequisites I have written another c# application (myAppInstaller.exe). This installer should do the complete installation (I don't want a separate installer like installshield...).

Now I would like to put the myAppInstaller.exe and all Tools, programs, Batches, Files etc. which are needed on a Network directory, so all users could click the myAppInstaller.exe on the Network path and the application will be installed on local pc. For example the user clicks N:\Software\MyApp\myAppInstaller.exe. This c# installer calls now a bat-file which calls for example "dism /online /enable-feature:IIS-WebServerRole".

Now the Problem: If the user executes the exe normally with doubleclick, the dism-call gives an error like "Admin rights needed". If the user executes the exe "run as Administrator", now the bat-file could not be found anymore. If I have all of the files on local Client, everything works with running as Administrator. Why is this not working when I call the exe on the networkpath?

Thank you very much for your help.

Christoph Fink
  • 22,727
  • 9
  • 68
  • 113
Marc
  • 137
  • 3
  • 10
  • 1
    `I don't want a separate installer like installshield` - Why? They solve exactly the problems you are having... – Christoph Fink May 07 '14 at 08:54
  • There are too much specific things to do. Then I Need many Parameters from an XML, I would have a specific log, the install should be silent and I Need specific and controlled Abort,cancel and restart/retry situations etc. I would like to control the whole Installation. – Marc May 07 '14 at 09:17
  • Does this help: http://stackoverflow.com/questions/2818179/how-to-force-my-net-app-to-run-as-administrator-on-windows-7 ? – Christoph Fink May 07 '14 at 09:27
  • I will also use custom installer (because I hate NSIS scripting and WIX xml alltogether). Idea is to embed nice looking wpf-installer (which in turn embed all the rest) into unmanaged c/c++ exe-file (without std = no prerequisites). This exe-file will request admin rights (Linker setting) and will extract wpf-installer into temp-folder and run it. Perhaps you could also do the same? Btw, You can right click bat-file and start it as admin. – Sinatr May 07 '14 at 09:31

1 Answers1

0

The mapped network drives are mapped per user-(token/account).

The access token of windows is spitted into two parts. if you are logged in and the second if you have used "run as admin".

normal you map the drives as none admin. this is the reason why the admin-token can't see the drives.

this is also related to already authorized UNC-path's.

coding Bott
  • 4,287
  • 1
  • 27
  • 44