Makarand_Keer

Hi

I am having Windows Service and a setup project for this service. In set up project I am taking inputs from user using UserInterface (TextBoxes (C) ) and Custom Action. However when User entered any thing with spaces in it my installer fails giving following error

System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\WINDOWS\system32\With' or one of its dependencies. The system cannot find the file specified.., (NULL), (NULL), (NULL).

I am having followin code in my Installer class

public override void Install(System.Collections.IDictionary stateSaver)

{

System.Diagnostics.EventLog.WriteEntry("My Setup", "Install");

StringDictionary myStringDictionary = this.Context.Parameters;

if (Context.Parameters.Count > 0)

{

foreach (string myString in Context.Parameters.Keys)

{

System.Diagnostics.EventLog.WriteEntry("My Setup", myString + " - " + Context.Parameters[myString]);

}

}

base.Install(stateSaver);

}

It works perfectly fine if there are no spaces in User Input.

Any help is appreciated

Makarand




Re: ClickOnce and Setup & Deployment Projects Error - System.IO.FileNotFoundException When text with Spaces entered in Custom User Interface

ahmedilyas

Thread moved to the correct forum




Re: ClickOnce and Setup & Deployment Projects Error - System.IO.FileNotFoundException When text with Spaces entered in Custom User Interface

Makarand_Keer

First of all sorry for putting my problem in wrong Forum.....

Second thing is, I guess I have found the soultion for my problem.

I was setting CustomActionData property of Install aciton as /TEST=[EDITA1]

When I changed it to /TEST="[EDITA1]" it start working, I did not know quotation marks makes so much of differences.

It would have been nice if this behavior is documented some where .

Thanks

Makarand






Re: ClickOnce and Setup & Deployment Projects Error - System.IO.FileNotFoundException When text with Spaces entered in Custom User Interface

David Guyer MSFT

Actually, it is pretty well documented :-)

If you go to: http://msdn2.microsoft.com/en-us/library/2w2fhwzz.aspx (or press F1 on the property in the editor)

And then check out where it says:

If the value has a space in it, it must be surrounded by quotation marks: /name="a value".

Glad you are up and running!






Re: ClickOnce and Setup & Deployment Projects Error - System.IO.FileNotFoundException When text with Spaces entered in Custom User Interface

PRISM

It looks like this is broken right now. I have an install routine that works just fine until I added the TARGETDIR path as an input parameter, e.g.,

/REG_FILE="0" /TGT_FOLDER="[TARGETDIR]"

All the Install method does is:

Code Snippet

bool bRegisterFile = true;

string strTargetFolder = "";

if (this.Context.Parameters.Count > 0)

{

bRegisterFile = this.Context.Parameters["REG_FILE"] == "1";

strTargetFolder = this.Context.Parameters["TGT_FOLDER"];

}

I have also tried not doing anything with TGT_FOLDER, i.e., I just passed the target dir parameter and that alone breaks the install routine with the FileNotFoundException. I'm running all the latest VS2005, OS and Sps.

Anyone else experiencing this






Re: ClickOnce and Setup & Deployment Projects Error - System.IO.FileNotFoundException When text with Spaces entered in Custom User Interface

David Guyer MSFT

Have you tried "[TARGETDIR]\"




Re: ClickOnce and Setup & Deployment Projects Error - System.IO.FileNotFoundException When text with Spaces entered in Custom User Interface

PRISM

David Guyer MSFT wrote:
Have you tried "[TARGETDIR]\"

I have not. The install log shows that the passed path already ends in a backslash. Just curious, why would this make a difference It just adds the step of having to remove the extra slash. I'll try it and report back. Thanks.






Re: ClickOnce and Setup & Deployment Projects Error - System.IO.FileNotFoundException When text with Spaces entered in Custom User Interface

PhilWilson

Well the backslash is the documented way, and I don't believe you don't need to remove it. It's there for the internal parser that has to figure out where tokens start and finish.

http://msdn2.microsoft.com/en-us/library/2w2fhwzz(VS.71).aspx






Re: ClickOnce and Setup & Deployment Projects Error - System.IO.FileNotFoundException When text with Spaces entered in Custom User Interface

PRISM

Okay, adding the backslash worked and the install completed successfully, however, now when I try to uninstall the package, I get:

An exception occurred while uninstalling. This

exception will be ignored and the uninstall will continue.

However, the application might not be fully uninstalled

after the uninstall is complete. --> Access to the path

'MyCustomInstaller.dll' is denied.

WHAT




Re: ClickOnce and Setup & Deployment Projects Error - System.IO.FileNotFoundException When text with Spaces entered in Custom User Interface

PRISM

PRISM576938 wrote:

Okay, adding the backslash worked and the install completed successfully, however, now when I try to uninstall the package, I get:

An exception occurred while uninstalling. This

exception will be ignored and the uninstall will continue.

However, the application might not be fully uninstalled

after the uninstall is complete. --> Access to the path

'MyCustomInstaller.dll' is denied.

WHAT

For now, I got around this problem by removing the property that passes TARGETDIR and commenting out the code that uses it. I also compiled a new version with RemovePreviousVersions set to false. I was able to install it and then remove the older entry from Add/Remove programs. I'm now back where I started prior to this madness.