Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Failure of .msi custom action using UWS .NET Configuration API
Chris.Sieben
#1 Posted : Monday, November 7, 2011 5:49:33 PM(UTC)
Groups: Member
Joined: 9/7/2010(UTC)
Posts: 14
Location: St. Cloud, MN

Was thanked: 2 time(s) in 2 post(s)
I have setup/install project in VS2010 which includes a CustomAction component packaged as a class library DLL.
My CustomAction dll is attempting to use the UWS.Configuration namespace components added as a reference.

When I run my setup.exe, i get an error:
Error 1001. Exception occurred while initializing the installation:
System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\SysWOW64\Files' or one of its dependencies. The system cannot find the file specified..


The file it is looking for is not listed, but I suspect it has something to do with the following dependency:
FirewallAPI.dll.
File Attachment(s):
UWS.Installer.log.txt (6kb) downloaded 269 time(s).
Chris.Sieben attached the following image(s):
Chris.Sieben attached the following image(s): UWSinstall.png
Ultidev Team
#2 Posted : Monday, November 7, 2011 6:06:20 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hello, Chris.

If exception occurs in your custom step, please try catching exception and writing it somewhere, like Windows Event Log or a file, along with stack trace - that will tell you exactly what is causing the issue. Also, what does make you think it's related to Windows Firewall? If you happen to have more information, please let us know, because UWS installation log looks perfect with no hint of any error.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Chris.Sieben
#3 Posted : Tuesday, November 8, 2011 9:40:47 AM(UTC)
Groups: Member
Joined: 9/7/2010(UTC)
Posts: 14
Location: St. Cloud, MN

Was thanked: 2 time(s) in 2 post(s)
Here is screen shot of my custom action dll project References. When you add the reference you can see that the setup project (which includes my custom action dll) will now detect some dependencies (see second screen shot).

The exception is handled by the windows installer when it can't load my custom action dll. So I don't get a chance to handle the exception in my code because it doesn't load.
Chris.Sieben attached the following image(s):
Chris.Sieben attached the following image(s): UWSinstallproject.addref.png
Chris.Sieben attached the following image(s): UWSinstallproject.depends.png
1 user thanked Chris.Sieben for this useful post.
Ultidev Team on 11/8/2011(UTC)
Ultidev Team
#4 Posted : Tuesday, November 8, 2011 10:33:45 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Chris,

We were able to reproduce the problem. We are working on it and will let you know soon whether we have a work around besides using command-line registration, and when the fix will be released.

Could you please let us know about why you chose Configuration API instead of command line application registration utility? Particularly, we would like to know what config API can do for you that command line reg utility can't.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Chris.Sieben
#5 Posted : Tuesday, November 8, 2011 11:57:11 AM(UTC)
Groups: Member
Joined: 9/7/2010(UTC)
Posts: 14
Location: St. Cloud, MN

Was thanked: 2 time(s) in 2 post(s)
I am installing my application on same computer as I installed UWS. I am assuming that the UWS install ran correctly based on the UWS install log. I am running setup.exe as administrator.
I tried to exclude the 4 dependencies but the same error results.
I don't think install is going to be able to load dlls from the C:\Windows\SysWOW64 folder.
Ultidev Team
#6 Posted : Tuesday, November 8, 2011 3:07:11 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Chris,

We need to figure it out because all those assemblies are installed into GAC. We'll keep you posted.

While we are working on it, could you please tell us what does configuration API have that is missing from the command line registration utility?

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Chris.Sieben
#7 Posted : Tuesday, November 8, 2011 5:10:14 PM(UTC)
Groups: Member
Joined: 9/7/2010(UTC)
Posts: 14
Location: St. Cloud, MN

Was thanked: 2 time(s) in 2 post(s)
I had not looked at the command line utility. I just chose the .NET api method as the most appropriate for what I was doing. I hope you can sort it out. Let me know if I can help.

It looks like the command line utility has similar/same options. I won't be able to try it out this week anymore. I can look into it next week perhaps.
Ultidev Team
#8 Posted : Tuesday, November 8, 2011 7:24:57 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hello, Chris.

We are recommending command line registration as it's the simplest one. Configuration API might be more useful in some rare advanced cases, where command line cannot be used. We will do our best to fix the problem with the configuration API soon, though, so you could register the application any way you want it.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Ultidev Team
#9 Posted : Wednesday, November 9, 2011 10:56:46 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Chris,

Turns out, we were unable to reproduce the problem. We marked all the assemblies you have highlighted as excluded, because all of them are in GAC or PATH, and we were able to make our test project work.

The cause of failure of our test project that registers ASP.NET Application using UWS Configuration API was MSI "error 1001 could not find xxxx.InstallState file". To make the problem go away we simply made sure that Install custom step in Setup project is hooked up to the assembly with custom action implementation, even though it does override Install method.
Quote:
When using .NET Installer class for custom actions, be sure to always hook up Setup project's Install custom action to the installer assembly, even if your Installer class does not override Install() method.


Attached is the sample Visual Studio 2010 solution that uses Installer class, Setup project's custom actions, and UWS.Configuration API to register/unregister a simple ASP.NET application. Please try to build it and see if this installation fails as well.

Best regards,
UltiDev Team.
File Attachment(s):
UWS ASP.NET App Redistribution Example.zip (32kb) downloaded 146 time(s).
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Chris.Sieben
#11 Posted : Tuesday, November 15, 2011 4:03:09 PM(UTC)
Groups: Member
Joined: 9/7/2010(UTC)
Posts: 14
Location: St. Cloud, MN

Was thanked: 2 time(s) in 2 post(s)
Thank you for the example solution. This was very helpful. I was able to compare it with mine and finally figured it out. It is a little embarrassing but...

The problem is described here:
<<http://blogs.msdn.com/b/helloworld/archive/2008/03/11/did-you-know-how-to-correctly-pass-targetdir-to-a-custom-action.aspx>>

Summary: When you pass the TARGETDIR paramenter to a Custom Action is should be enclosed in quotes and followed by a backslash character like this:
AppLocation="[TARGETDIR]\"

Now that I am passing the parameter correctly everything is working great. When I get a chance, I will upload the project in case anyone want to do something like it.

I noticed that your example custom action was registering in the Commit method rather than the Install method. Do you have any reason why Commit is better/preferred over Intall?
Ultidev Team
#12 Posted : Tuesday, November 15, 2011 9:30:50 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Oh yeah, the trailing backslash in TARGETDIR - that's the most bizarre requirement in existence, it has no merit and therefore there is nothing embarrassing in not knowing about it. Visual Studio setup project is quite a sham. Little things like this is why we went with recommending command line-based application registration instead of installer class and UWS configuration API. UltiDev Cassini experience shown us that command line is easier for developers.

There is no real reason behind putting application registration into the Commit action, Install should work just as fine.

Thank you for contributing your solution to the knowledge pool!

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#13 Posted : Tuesday, March 8, 2016 2:23:04 AM(UTC)
Groups:

Message was deleted by a Moderator.
Rss Feed  Atom Feed
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.