473,698 Members | 2,450 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 1270
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
19302
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
10896
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
5422
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
5598
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
1732
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
1230
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
1802
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
4464
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
8604
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
9160
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
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...
0
7729
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...
0
5860
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
4370
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...
1
3050
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
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.