473,729 Members | 2,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding file to exe on the fly

I have an exe. When one of admin runs it creates a file. This file is
required for the exe to run when we deliver to client. Is it possible
to add the file into the exe when the admin runs instead of
recompiling the code?
In otherwords, is it possible to add a file to the exe or add a
resource to the executing exe?
Thanks,
Sep 15 '08 #1
5 1273
CSharper <cs******@gmx.c omwrote:
I have an exe. When one of admin runs it creates a file. This file is
required for the exe to run when we deliver to client. Is it possible
to add the file into the exe when the admin runs instead of
recompiling the code?
In otherwords, is it possible to add a file to the exe or add a
resource to the executing exe?
It's possible, but it would be relatively tricky. Why not just keep the
file separate but in the same directory?

--
Jon Skeet - <sk***@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Sep 15 '08 #2
On Sep 15, 1:47*pm, Jon Skeet [C# MVP] <sk...@pobox.co mwrote:
CSharper <cshar...@gmx.c omwrote:
I have an exe. When one of admin runs it creates a file. This file is
required for the exe to run when we deliver to client. Is it possible
to add the file into the exe when the admin runs instead of
recompiling the code?
In otherwords, is it possible to add a file to the exe or add a
resource to the executing exe?

It's possible, but it would be relatively tricky. Why not just keep the
file separate but in the same directory?

--
Jon Skeet - <sk...@pobox.co m>
Web site:http://www.pobox.com/~skeet*
Blog:http://www.msmvps.com/jon.skeet
C# in Depth:http://csharpindepth.com
We wanted to ship only one file out (management requirement). Thanks
and could you please tell me how to go about doing it?
Thanks,
Sep 15 '08 #3
CSharper <cs******@gmx.c omwrote:
We wanted to ship only one file out (management requirement). Thanks
and could you please tell me how to go about doing it?
Find the format of the exe file (PE format) and rebuild it all. It'll
be a massive pain though. I would strongly urge you to ask management
just how much they want this.

--
Jon Skeet - <sk***@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Sep 15 '08 #4
On Sep 15, 3:20*pm, Jon Skeet [C# MVP] <sk...@pobox.co mwrote:
CSharper <cshar...@gmx.c omwrote:
We wanted to ship only one file out (management requirement). Thanks
and could you please tell me how to go about doing it?

Find the format of the exe file (PE format) and rebuild it all. It'll
be a massive pain though. I would strongly urge you to ask management
just how much they want this.

--
Jon Skeet - <sk...@pobox.co m>
Web site:http://www.pobox.com/~skeet*
Blog:http://www.msmvps.com/jon.skeet
C# in Depth:http://csharpindepth.com
Is it possible to to have a place holder in the file and then replace
the content of the file later somehow? My other option is to use
ILMerge.
Sep 16 '08 #5
On Sep 16, 1:15*pm, CSharper <cshar...@gmx.c omwrote:
Is it possible to to have a place holder in the file and then replace
the content of the file later somehow? My other option is to use
ILMerge.
Either of those *might* work - but you'll need to look into the PE
format and dig around to find out for sure.

Jon
Sep 16 '08 #6

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

Similar topics

4
19310
by: Garry | last post by:
Hi, I am new to python, hope someone can help me here: I have a MS Access exported .txt file which is tab delimited in total 20 columns, now I need to add another column of zero at the 4th column position and a column of zero at the 9th column position. What is the best way to do this? Can I write a while loop to count the number of tab I hit until the counter is 4 and then add a zero in between and thru the whole file? Thanks, Garry
9
10900
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent the wheel, right? Everything so far is working well with the Active Directory. The problem I am having is with adding File Permissions to a directory. I am currently using some code courtesy of "Willy Denoyette "
7
5427
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
1
5601
by: Christopher W. Douglas | last post by:
I am building a VB.NET application in Visual Studio.NET 2003. I have an existing project with code and forms I want to reuse in this project. If I am copying a module file, then Add Existing Item works fine. However, if I am copying a form, it pulls it in as a module file, not as a form. I have tried adding the .resx file first, adding the .vb and .resx file at the same time, or deleting the .resx file, nothing seems to work. I have a...
1
1734
by: Max | last post by:
Searched all over google and can't seem to find how to do this. How do I go about adding comments about my own functions and sub-procedures? Like when I use them, the tool-tip tells me more then just how it was declared?
6
1234
by: UJ | last post by:
I have a couple of files (type definitions, constants, ...) that I want to use in multiple projects. How do I make it so that I have only one copy of the file for multiple projects? If I do add existing to a project, it copies the file to the project directory. I'd like to have a single directory (called something like library) that has all the common source code in it that then gets referenced from the projects. TIA. Jeffrey.
4
1804
by: Saurabh Aggrawal | last post by:
Hi, I have made a dll and it is working fine in the debug build (as expected) but when I run it in the release build it is working strangely. For example, the dll saves the 10 properties on the exit to a .txt file and when it get loaded again these properties are read from the text file and shown on the user interface. Dll can save the values to the text file correctly for both debug and
5
4465
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.
1
2685
by: John | last post by:
Is there such a thing as storing icons or bitmaps into a resource file, and adding more icons or bitmaps into the resource file at runtime? I want to store a bunch of icons into a resource file, and at runtime I want to be able to add more icons as I need to add. I don't want to use an imagelist because that will be a set number of icons in the program.
0
8917
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
8761
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
9281
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
9200
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,...
1
6722
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
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2680
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.