473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Adding an embedded resource without making a local copy

Is there any way to add an embedded resource to a project without copying it
to the project's directory? I have shared resources and don't want each
project using the images, xml files, etc. to need to be updated with the
current copy before being built. I also don't want projects being built with
the old copy.

Thanks!

Bill

Nov 17 '05 #1
7 5376
Wysiwyg <wy*****@xmissionNSPAM.com> wrote:
Is there any way to add an embedded resource to a project without copying it
to the project's directory? I have shared resources and don't want each
project using the images, xml files, etc. to need to be updated with the
current copy before being built. I also don't want projects being built with
the old copy.


Any reason not to have the resources in a single project? You could get
the resources from that assembly, rather than having multiple copies,
one per assembly.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2
Sorry I didn't reply sooner, my usual news server keeps missing messages so
I switched to msnews.microsoft.com and found your reply.

I'm writing a program to install an addon for a business application. The
add on is application event driven and can have several forms, menus, etc.

I have to reference an installer library from the application and write code
for it so I can't just package the install with Wise Installer, MS
Installer, etc. The install exe has to run from the application and sends
events for installation started, in progress, ending, etc. I have to
generate both an installer executable and an add-on executable which is run
by the application. The application I'm writing for requires that the
add-ons be started with executables rather than linking to a dll. The
application also requires that the installer's creator generate an add-on
registration file which contains checksums of both the installer and addon
executables.

I couldn't find a way to link files I need included in the installer exe and
have them included/embedded in the installer file that would be simpler than
creating a resources directory in the installer project, adding (and
copying) all of the files I need to that resources directory as embedded
resources, and subsequently executing a prebuild command for the installer
to copy the current files to this "resources" directory. The installer would
then extract the files from the executing assembly's manifest which start
with "installer.resources." for an example.

I'd like a way to include files on the installer's manifest or a way to link
to another project's manifest and have those resources included within the
install executable regardless of file type. If I was writing a regular
windows app I could just use the MS Installer to package the entire solution
but as it is I have to write everything myself and extract the files myself.

Thanks for any assistance!
Bill Faulk

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Wysiwyg <wy*****@xmissionNSPAM.com> wrote:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each
project using the images, xml files, etc. to need to be updated with the
current copy before being built. I also don't want projects being built with the old copy.


Any reason not to have the resources in a single project? You could get
the resources from that assembly, rather than having multiple copies,
one per assembly.

Nov 17 '05 #3
Wysiwyg <wy*****@xmissionNSPAM.com> wrote:

<snip>
I couldn't find a way to link files I need included in the installer exe and
have them included/embedded in the installer file that would be simpler than
creating a resources directory in the installer project, adding (and
copying) all of the files I need to that resources directory as embedded
resources, and subsequently executing a prebuild command for the installer
to copy the current files to this "resources" directory. The installer would
then extract the files from the executing assembly's manifest which start
with "installer.resources." for an example.


What did you try in terms of having a class library project which just
contains resources? Presumably you're adding other projects into your
installer - what's different about a class library one? I've a feeling
I'm missing something about your problem...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4
By resources I don't just mean icons and bitmaps. There xml and dll files
plus at least one exe file which need to be installed as well. The
application doesn't let me just link to a library for the addon. I can't
just call a method in a library to execute my add on. I have to install at
least one exe file that is run from the application where the addon will be
registered. I really don't see how I can include all of these resources in a
class library given the requirements of the application that executes the
installation program and runs the addon. The installation program doesn't
actually need to access any of the resources it installs; It just needs to
put them on the filesystem in the right place. I'm not going to be using
rundll32.exe. :-)

Even if all the installer was required to install was a single executable
from another project and required no other resources I would still have the
original question: How do I include this external file with my installation
without copying it to the installation project?

Thanks!
Bill Faulk

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Wysiwyg <wy*****@xmissionNSPAM.com> wrote:

<snip>
I couldn't find a way to link files I need included in the installer exe and have them included/embedded in the installer file that would be simpler than creating a resources directory in the installer project, adding (and
copying) all of the files I need to that resources directory as embedded
resources, and subsequently executing a prebuild command for the installer to copy the current files to this "resources" directory. The installer would then extract the files from the executing assembly's manifest which start with "installer.resources." for an example.


What did you try in terms of having a class library project which just
contains resources? Presumably you're adding other projects into your
installer - what's different about a class library one? I've a feeling
I'm missing something about your problem...

Nov 17 '05 #5
Wysiwyg <wy*****@xmissionNSPAM.com> wrote:
By resources I don't just mean icons and bitmaps. There xml and dll files
plus at least one exe file which need to be installed as well.
That's fine - they can all be embedded as resources in an assembly.
The application doesn't let me just link to a library for the addon. I can't
just call a method in a library to execute my add on. I have to install at
least one exe file that is run from the application where the addon will be
registered. I really don't see how I can include all of these resources in a
class library given the requirements of the application that executes the
installation program and runs the addon. The installation program doesn't
actually need to access any of the resources it installs; It just needs to
put them on the filesystem in the right place. I'm not going to be using
rundll32.exe. :-)

Even if all the installer was required to install was a single executable
from another project and required no other resources I would still have the
original question: How do I include this external file with my installation
without copying it to the installation project?


By putting it as an embedded resource in your class library assembly,
and making that part of the installation project.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #6
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Wysiwyg <wy*****@xmissionNSPAM.com> wrote:
Even if all the installer was required to install was a single executable from another project and required no other resources I would still have the original question: How do I include this external file with my installation without copying it to the installation project?


By putting it as an embedded resource in your class library assembly,
and making that part of the installation project.


So how would I add an embedded resource to a class library assembly in a way
that's different than adding a file to the project and selecting "embed
resource" as it's build action? If there isn't any other way then that
doesn't gain me anything.

The output for the projects to be installed are not, and will not be, class
librarys since they must be exe files due to restrictions of the application
that will use them. While I can and do put shared resources into class
librarys adding the compiled exe output of other projects into a class
library for the installer does not make sense to me.

I was just looking for a way to embed the exe files that need to be
installed into the installation project without copying them to the actual
directory of said project. If I had to embed those exe files in a class
library then I'd be looking for a way to do so without copying those
resource files to the project of the class library.

Bill Faulk
Nov 17 '05 #7
Actually I found what I was originally asking for. When adding an existing
item there is a drop down next to "open" which allows you to select
"open","open with...", and "link". The link option is what I was looking
for.
Is there any way to add an embedded resource to a project without copying itto the project's directory? I have shared resources and don't want each
project using the images, xml files, etc. to need to be updated with the
current copy before being built. I also don't want projects being built withthe old copy.

Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andreas Håkansson | last post by:
Is it possible, with the use of code, to add a resource to an assembly? Perhaps using the ResourceWriter ? Basiclly I want to do the equivalent of adding a file to my project and making it an...
5
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception...
2
by: Don Tucker | last post by:
Hello, I have a Windows Application that needs to load multiple image files in response to users clicking buttons. Currently, I just have these images as .jpg files on disk, but I don't want to...
16
by: Marina | last post by:
Hi, I am trying to find the minimum security settings to allow a windows control embedded in IE have full trust. If I give the entire Intranet zone full trust, this works. However, this is...
0
by: Wysiwyg | last post by:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each project using the images, xml files, etc. to...
6
by: Derek Martin | last post by:
Hi there, I have a couple of bitmaps that are called in my project that I need to use. They were added to my solution as existing objects and are located in the same folder as the rest of the vb...
3
by: Larry Serflaten | last post by:
I am making a DLL that has a class that will be made into several similar objects for the user. I have a .gif file that has all the parts those objects need. I am wondering what the proper way...
5
by: DBC User | last post by:
I have a situation, where I need to add 4 or 5 data files (they change every time I build) in my project during build time and somehow I need a way to access these files during runtime. So I have...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.