Saturday, March 29, 2008

Custom Actions With .Net Installer Class Yields Weird Error

The Error

The other day I was writing a custom installer for some SharePoint stuff. I ended up customizing the UI a little and mapping those user inputs to properties that I would refer to some custom actions class that I wrote.

I was following a tutorial on the web and everything seemed to be going fine until I added all my properties, ran the installer and then bam!

Low to my surprise, when I ran the installer I ended up getting an error of the form:

Error 1001. Exception occurred while initializing the installation: System.IO.FileNotFound: Could not load file or assembly 'file:///[path]' or one of it's dependencies. The system cannot find the file specified.

I ended up digging around on the web for a bit and couldn't really find anything, so after I fixed it I decided that this gotcha might deserve to be immortalized in a blog entry.

The Solution (at least for me)

The fix was of course something silly. I'm almost embarrassed. When you pass custom properties that are file paths that include spaces in them (ie. 'C:\Program Files\...') you need to wrap the whole path in quotes, this goes for custom properties too.

Further more if you're passing in the path of the installation directory (TARGETDIR) you need to not only wrap it in quotes but also put a back slash on the end of it.


There's more information on the MSDN.

So I fixed my custom action expressions by wrapping them in quotes (and putting a trailing backslash on [TARGETDIR] AND I'm good to go! No more angry error.Putting quotes (

Maybe next time I'll RTFM.



Anonymous said...

Old post but still very useaful, thanx! :)

electronic signature pad said...

I really liked this post. You explain this topic very well. I really like your blog and I will definitely bookmark it! Keep up the super posts!

for ict 99 said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru Dot Net Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

for ict 99 said...

IEEE Cloud computing DOamin is a general term for anything that involves delivering hosted services over the Internet. IEEE Projects on Cloud Computing The cloud is a metaphor for a global network of remote servers which operates as a single ecosystem, commonly associated with the Internet. IEEE FInal Year Project Domains Final Year Projects for CSE cloud computing is the delivery of computing services—including servers, storage, databases, networking, software, analytics, and intelligence

JavaScript Training in Chennai

JavaScript Training in Chennai

tike mik said...

They say that there's nothing stranger than real life, and when Hollywood screen writers are looking at new ideas for movie storylines, they often turn to taking historical events and making some great movies.


SEO said...

A cool thing I've been hearing about is that there are film investors that won't put up money to make movie that is going to be self-distributed, but they will roll the dice on a feature that is going to specific film festivals. Not the art house film festivals.ffmovies

Rumi said...

Full disclosure: all of these action movies are now past their theater screening time and have made it to home viewing. That said, there are still some really great theaters out there that not only provide first-run movie releases, but they also go so far as to host theme movie nights that screen celluloid classics for the fan that just needs to see their favorite films back where they belong - on the big screen.

Rumi said...

My website contains many articles just like this one. Analyzing the important life messages presented in our favorite movies. If you liked this one, you will love what my site has to offer! As always, I will reply to all blog comments.

SEO said...

Simultaneous release, both internationally and between cinema and home-viewing (i.e. DVD or legal download) is a necessity for this to start happening and, according to Matt Mason, author of 'The Pirates Dilemma' says that can't happen "until DVDs/Blu Ray are well and truly dead and buried" He goes on to say that "we'll see the studios using file sharing sites more to promote films, and content deals between the studios and torrent sites are already happening."123 movies

tike mik said...

Here is the crucial thing: your sheet should be short and to the point. This sheet is a cliff notes to the strongest features of your film.