473,225 Members | 1,190 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,225 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 5341
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: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.