.NET Installer - FileNotFound error

  • Thread starter Thread starter MovnOn
  • Start date Start date
M

MovnOn

I've created an installation package for my program.
Before installation, I use the User Interface to get
values that are added to the registry. One of the values
that the user must add is a path to a required input file
for the program. I'm finding that if the user enters a
path which contains a space (example: c:\Program
Files\myProgram\file.txt) that the install will return a
file not found error and abort the install.

I don't understand why the install is even checking that
the file exists, since I'm overriding install with my own
code and I didn't include any code to check that the file
exists. It's not important that the file exist when the
program is installed, only that it exists at runtime
(program will abort if it doesn't exist).

Why does the install check the path and how do I make sure
that it doesn't do that?
 
This sounds a bit odd, I don't know anything off the top of my head that
would cause this, or check for the file. But, it's still a little unclear
to me how things are hooked up in your setup. For example, are you using a
custom action? You said that you are overriding install... perhaps its
something in there?

If you are overriding install, you should call mybase.install, so that the
state document is written, as it's needed by the commit method. That might
be it, and the value entered by the user might be a red herring.
 
So, I'm still not sure what's reading/writing these values, especially
since I think setMorvisionDSN, and other methods are user code.

I'm concerned with stateSaver.Clear, and the fact that you aren't adding
these values from the context into the stateSaver. These are usually used
to uninstall stuff during Rollback and Uninstall methods.

If you'd like to try to debug into your custom action, you can add a line
System.Diagnostics.Debugger.Launch which will bring up the Just In Time
debugger dialog and allow you to attach your IDE to your running custom
action. Then you can step through the code to see if it's in there.
 
How do I add values into stateSaver?

I tried adding the debugging code as the first line in the Install
subroutine, but the error is occurring before the code. I entered the
path C:\Program Files\master.ini and got the error:

Exception occurred while initializing the installation;
System.IO.FileNotFoundException: File or assembly name master.ini, or
one of its dependencies, was not found.

If I enter C:\ProgramFiles\master.ini, I don't get the error even though
this file/path doesn't exist.
 
Back
Top