Running C# installation program from network drive

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Our installation process is very very different from the typical "copy files
+ add shortcuts" scenario. Because of this we've developed a custom
installation program in C#. The program works great when we run it from a
local drive but when it executes from a network drive the program raises a
SecurityException (the CAS bites us basically). I've read a ton about CAS and
ClickOnce etc now, but I still don't understand how to fix my program
properly.

The requirements on our installation program is basically:
* it needs to read/write to system registry
* it needs to read/write to file system
* it needs to call unmanaged code
* must run from any network drive (we don't know server name or share name
or anything like that)
* must NOT require configuration before launch (this is after all an
installation program, the very purpose of our installation program is to
relieve the user from any tedious configuration tasks)


So basically, telling our uses to run caspol.exe before they launch
installer.exe is out of the question. Also, we want to support users storing
the installer.exe binary on *their* network drives; so it's not like we can
choose which network location the installer will start from.

Any advice on how to implement this smoothly would be greatly appreciated.
Thanks!


Regards,
Martin
 
You need to look into using a .Net Setup Project or InstallShield.
Either way, running your installation program is going to require
administrative privileges to run properly.
 
What's so special about a "setup project"? Can't I just add that something
to my existing installer? I already wrote the complete GUI etc so I'd rather
not start over from scratch just because I want it to run from a network
share.

Regards,
Martin
 
Setup projects create MSI packages which are installed by the Windows
Installer service. The Windows Installer server can inspect the package
and prompt for administrator credentials if required.

You can still use custom code in an MSI package by adding a custom
action that references your .Net assembly.

An alternative might be to run your code from the network share, have
your code copy its files locally, and re-execute itself from the local
workstation.

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net
 
Back
Top