I have a program that will ran from a mapped drive (at least with most of our clients). The drive is typically on the local machine. For example S:\ will be mapped to C:\myDir. My application create's a file that contains a timestamp of when an event occured.
If I place my executable in C:\myDir everything runs as expected. Here's the interesting part. If I open a Windows explorer and navigate to the S:\ drive (which is C:\myDir), I get a permissions error when I try to write to my file. I've verified that the permissions on my mapped drive is set to full control.
Here's the code. Is there something about using streamwriter across networks?
vb Code:
Private Sub SetTime()
Try
dTime = Date.Now
Using sw As StreamWriter = New StreamWriter(My.Settings.InProgessFile)
This is to do with 'trust'. Running applications on the C: drive of your machine is 'trusted' since you put them there. Running apps that are located elsewhere or downloaded are treated as untrusted.
I personally use INNO as my installer for .NET applications, and during installation, I have INNO run CASPOL, which is an exe that comes with the .NET framework. Any machine that has the framework installed has CASPOL. It is the Code Access Security POLicy editor.
I launch it, giving full trust to my application incase the user installs it to a network drive. Honestly it is not the most graceful approach, but the bottom line is that it works, and my end users would not know how to manually configure something like that. Not to mention the GUI that was in the control panel under administrative tools for caspol which used to come with the .NET framework no longer does starting with .NET 2.0.
It only gets installed when you install the .NET 2.0 SDK, not just the framework. So you have to do it command line on a given client PC.
This should probably be another thread but it is related to my current problem as well. I've seen numerous posts from you in which you recommend the use of INNO. What is the learnign curve for this tool?
In the past my company has used MSI and last year migrated to Caphyon (not sure why). To make a long story short, this year I get the pleasure of creating our release disk. As with most software companies the release is due in two months and we have four months of development to complete, so the easier the release packaging is the better.
I always mention it, but I often do tell people its not as simple as pickup and go, largely because its scripted, and not driven by a GUI to create your installer.
It's more or less a glorified notepad that you write everything in, and then compile, which makes your setups.
I picked INNO over learning all the in's and out's of Microsoft's built in installer in visual studio because at the time I supported VB6, VB.NET and believe it or not 16 bit MS DOS apps written in QBasic.
I was able to use INNO to write installers for all of them because INNO is just an installer, it knows nothing about the language you wrote your app in.
It supports all the standard installer things like creating icons, registering files, etc.. there are even add-ins you can get for doing things like downloading files from the web during installation, etc..
the best thing is it it totally customizable. The down side to that is the code is written in pascal, not VB. There lies the biggest learning curve, but while I know literally nothing about pascal, I have some pretty advanced scripts written in it for INNO. I either find examples on the web, consult the help file, mess around until i get things working, or a combination of the 3.
I have been working on an INNO script to post here as an example of installing a .NET 2.0 application, but I have been really busy and I haven't had the time to do it up with all the needed comments.
Also, you could do the caspol thing with an MSI installer from Visual Studio, you would just have to create a custom action dll that would get used during the install process.