Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Setup / July 2005

Tip: Looking for answers? Try searching our database.

FileNotFoundException during a repair

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sander Kooij - 06 Jul 2005 10:21 GMT
Hello,

I have a problem with a setup project which I have created with Visual
Studio .NET 2003. In this project I have an extension DLL to perform
some custom actions. I am parsing the source location of my installer
(public property SOURCEDIR) to the custom DLL by using
CustomActionData property, /SourceFolder="[SourceDir]\". When I do a
regular install, everything seems to go fine, but with a repair
install I get an exception error:

> System.IO.FileNotFoundException: File or assembly name iXware, or one of its dependencies, was not found.

When I take a look at the generated log file, I see that the source
folder is not parsed to the extension DLL. The source folder attribute
only contains a backslash.

> Property(S): _37F2DD42_336C_46F0_9F8F_EF72F2B91F3F.install = /installtype=notransaction /action=install /LogFile= /SourceFolder="\" "

The strange thing this is that when I take a closer look at the log
file, I can see that the SOURCEDIR property does contain the Source
Location in the public variables.

> Property(S): SOURCEDIR = n:\release\

Has anyone ever encountered a similar problem, or knows a solution.

Thanks in advance,

- Sander Kooij
Phil Wilson - 07 Jul 2005 19:36 GMT
1) I'm a bit worried about your case-sensitivity! If the property is
SOURCEDIR then it needs to be [SOURCEDIR] when passed to CustomActionData.
On the other hand you might mean SourceDir the Windows Installer property.

2) Assuming you mean SourceDir, its value is resolved from the location of
the MSI file when it's being installed. You're not installing now, you're
doing a repair, and it doesn't resolve the location of the original MSI file
(you'd probably complain if you had to insert a CD). So the property has no
value.

I'd guess that you don't need to run the custom action on a repair, so a
condition of Not Installed on your custom action will prevent it being
called if the product is already installed (which is true during a repair).
Signature

Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

> Hello,
>
[quoted text clipped - 27 lines]
>
> - Sander Kooij
Sander Kooij - 08 Jul 2005 11:22 GMT
Sorry about the case-sensitivity. This is because I have tried out
both properties and I copied this fragment from the log of my last
attempt. Both unfortunately with the same result.

The reason I have to use a custom action during a repair is that I
have to write settings from a file, which is located in the same
folder as the setup files, to the registry. If the SOURCEDIR and
SourceDir properties are not provided during a repair-install is there
a way to force the setup into installation mode so these values are
set.

>1) I'm a bit worried about your case-sensitivity! If the property is
>SOURCEDIR then it needs to be [SOURCEDIR] when passed to CustomActionData.
[quoted text clipped - 9 lines]
>condition of Not Installed on your custom action will prevent it being
>called if the product is already installed (which is true during a repair).
Phil Wilson - 09 Jul 2005 19:38 GMT
The thing to do is to to have a registry entry in the Registry view of the
IDE. Give a name like MySource and have the value be [SourceDir]. This will
be resolved during the initial install to the actual value. Writing to the
registry is done before your install custom action runs, so your custom
action can always just get the location from that registry item instead of
from the SourceDir property.
Signature

Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

> Sorry about the case-sensitivity. This is because I have tried out
> both properties and I copied this fragment from the log of my last
[quoted text clipped - 23 lines]
>>called if the product is already installed (which is true during a
>>repair).
Sander Kooij - 11 Jul 2005 12:56 GMT
This works great for a new install. When doing a repair install
however, the registry value is set to empty. I think this is because
the SourceDir property is empty. This is strange because in the log
file, the SourceDir property seems to be set (see the log file
fragment below). The advantage of this solution is that no exception
occurs during the repair install. Is there another way to retrieve the
SourceDir property?

From the log file:
Property(S): SourceDir = Z:\

>The thing to do is to to have a registry entry in the Registry view of the
>IDE. Give a name like MySource and have the value be [SourceDir]. This will
>be resolved during the initial install to the actual value. Writing to the
>registry is done before your install custom action runs, so your custom
>action can always just get the location from that registry item instead of
>from the SourceDir property.
Phil Wilson - 11 Jul 2005 20:54 GMT
Ach, yes, the repair puts [SourceDir] in the registry as an empty string.
You probably need to write [SourceDir] to the registry yourself. I tried
this as a vbscript, works fine:

set shell = CreateObject("Wscript.Shell")
shell.RegWrite "HKLM\Software\Unisys\TestSetup\Location",
Session.Property("CustomActionData"),  "REG_SZ"

where [SourceDir] is passed as CustomActionData. This custom action needs a
condition of Not Installed so that it runs only when the product is not
installed (so it won't run during a repair). In addition, a Search Target
Machine can search for this value and put it in another property name
(MYLOCATION). Your custom action can be passed [MYLOCATION] in
CustomActionData. Then on first install you can use SourceDir, on a repair
the MYLOCATION property. It's a bit awkward, but I can't think of a better
way to do what you want with VS setup features.
Signature

Phil Wilson [MVP Windows Installer]
----

> This works great for a new install. When doing a repair install
> however, the registry value is set to empty. I think this is because
[quoted text clipped - 14 lines]
>>action can always just get the location from that registry item instead of
>>from the SourceDir property.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.