473,739 Members | 3,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5428
Wysiwyg <wy*****@xmissi onNSPAM.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.co m>
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.microsof t.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.reso urces." 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.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
Wysiwyg <wy*****@xmissi onNSPAM.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*****@xmissi onNSPAM.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.reso urces." 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.co m>
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.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
Wysiwyg <wy*****@xmissi onNSPAM.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.reso urces." 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*****@xmissi onNSPAM.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.co m>
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.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
Wysiwyg <wy*****@xmissi onNSPAM.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","ope n 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
1716
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 "embedded resource", but with the help of code on another assembly. -- ANDREAS HÅKANSSON STUDENT OF SOFTWARE ENGINEERING andreas (at) selfinflicted.org
5
8229
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 of type 'System.ArgumentException' occurred in system.drawing.dll Additional information: 'null' is not a valid value for 'stream'.
2
3510
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 have to migrate the files everywhere that the executable is installed. Is there a way to add them to a Visual Studio solution/project so that they are embedded in the application somehow? If so, how do I access the images when needed? Thanks,...
16
2120
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 very broad and gives the entire zone high privleges. I tried giving just the assembly full trust (using the full URL for the DLL), but this doesn't seem to work.
0
1048
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 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
6
3223
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 files. I set their Build Action to Embedded Resource and compiled without any errors, however, when calling them, like this inside Initialize Components: myclosebutton.SetCloseBitmap(New Bitmap(MyClass.GetType(), "close.bmp"),...
3
1364
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 to share that image across all the objects is so I don't end up with that single .gif loaded multiple times. I am thinking I should make a Friend class that has a shared property that returns the image, but I want to be sure it is returned...
5
4466
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 2 questions 1. Is it possible to identify all the files in the resource file during runtime by name of the file? 2. Is it possible to add files to a project at build time to make an exe with those files? Thanks.
8
14943
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 cut and paste code that MSDN recommends for playing a simple wav file from inside an embedded file, like presumeably the 'resources' file .resx is. I want to embed the .wav file in a 'resource file' since I don't want the user storing the file on...
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8794
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9341
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9269
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9211
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8216
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6756
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4572
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.