471,354 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Single Exe - No install program - Storing Settings

Hi,

I have been asked to create a solution in a single exe - using C# .NET 3.5.

I have found that I can us ILMerge to create a single exe of all of my
Application assemblies.

But my question is what to do about settings/config?

I have some settings should be settings which should be shared between
instances of the application but these settings could be changed by the user
overtime.

This is why I would not use the registy - let the user specify the settings
at first run.

Thanks in advance.

Lars
Sep 19 '08 #1
11 2950
Well you arent going to easily be able to recompile your app to change user
settings at runtime so I would suggest that an XML file or the registry are
the best way to go.

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"pbcoder" wrote:
Hi,

I have been asked to create a solution in a single exe - using C# .NET 3.5.

I have found that I can us ILMerge to create a single exe of all of my
Application assemblies.

But my question is what to do about settings/config?

I have some settings should be settings which should be shared between
instances of the application but these settings could be changed by the user
overtime.

This is why I would not use the registy - let the user specify the settings
at first run.

Thanks in advance.

Lars
Sep 19 '08 #2
I normally use xml or registy to store setting, but

The point about the application is that it should be easy to copy between
users simply by copy one file not have to copy several files - I know it
might be difficult/impossible thing to achieve.

Lars

"Ciaran O''Donnell" wrote:
Well you arent going to easily be able to recompile your app to change user
settings at runtime so I would suggest that an XML file or the registry are
the best way to go.

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"pbcoder" wrote:
Hi,

I have been asked to create a solution in a single exe - using C# .NET 3.5.

I have found that I can us ILMerge to create a single exe of all of my
Application assemblies.

But my question is what to do about settings/config?

I have some settings should be settings which should be shared between
instances of the application but these settings could be changed by the user
overtime.

This is why I would not use the registy - let the user specify the settings
at first run.

Thanks in advance.

Lars
Sep 19 '08 #3
If these users are in a corporate network then you should look at have a
central file somewhere they can all access, or if they are spread out over
the net then potentially a webservice where they can get the settings. It is
quite ellaborate to do that but you are asking for a difficult thing. The
settings will have to be somewhere.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"pbcoder" wrote:
I normally use xml or registy to store setting, but

The point about the application is that it should be easy to copy between
users simply by copy one file not have to copy several files - I know it
might be difficult/impossible thing to achieve.

Lars

"Ciaran O''Donnell" wrote:
Well you arent going to easily be able to recompile your app to change user
settings at runtime so I would suggest that an XML file or the registry are
the best way to go.

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"pbcoder" wrote:
Hi,
>
I have been asked to create a solution in a single exe - using C# .NET 3.5.
>
I have found that I can us ILMerge to create a single exe of all of my
Application assemblies.
>
But my question is what to do about settings/config?
>
I have some settings should be settings which should be shared between
instances of the application but these settings could be changed by the user
overtime.
>
This is why I would not use the registy - let the user specify the settings
at first run.
>
Thanks in advance.
>
Lars
Sep 19 '08 #4
Well unfortunately the users will not be on the same coporate network or may
not even have a network connection.

Could I have the settings as an embedded rescource and the alter it when
needed?

Lars

"Ciaran O''Donnell" wrote:
If these users are in a corporate network then you should look at have a
central file somewhere they can all access, or if they are spread out over
the net then potentially a webservice where they can get the settings. It is
quite ellaborate to do that but you are asking for a difficult thing. The
settings will have to be somewhere.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"pbcoder" wrote:
I normally use xml or registy to store setting, but

The point about the application is that it should be easy to copy between
users simply by copy one file not have to copy several files - I know it
might be difficult/impossible thing to achieve.

Lars

"Ciaran O''Donnell" wrote:
Well you arent going to easily be able to recompile your app to change user
settings at runtime so I would suggest that an XML file or the registry are
the best way to go.
>
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
>
>
"pbcoder" wrote:
>
Hi,

I have been asked to create a solution in a single exe - using C# .NET 3.5.

I have found that I can us ILMerge to create a single exe of all of my
Application assemblies.

But my question is what to do about settings/config?

I have some settings should be settings which should be shared between
instances of the application but these settings could be changed by the user
overtime.

This is why I would not use the registy - let the user specify the settings
at first run.

Thanks in advance.

Lars
Sep 19 '08 #5
Embedded resources are embedded into your application so you would need to
dissasemble the app, edit the settings file and reassemble it. Then work out
a way to replace the file which the application is still running.

Good luck with that, it will be impressive when you have finished
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"pbcoder" wrote:
Well unfortunately the users will not be on the same coporate network or may
not even have a network connection.

Could I have the settings as an embedded rescource and the alter it when
needed?

Lars

"Ciaran O''Donnell" wrote:
If these users are in a corporate network then you should look at have a
central file somewhere they can all access, or if they are spread out over
the net then potentially a webservice where they can get the settings. It is
quite ellaborate to do that but you are asking for a difficult thing. The
settings will have to be somewhere.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"pbcoder" wrote:
I normally use xml or registy to store setting, but
>
The point about the application is that it should be easy to copy between
users simply by copy one file not have to copy several files - I know it
might be difficult/impossible thing to achieve.
>
Lars
>
"Ciaran O''Donnell" wrote:
>
Well you arent going to easily be able to recompile your app to change user
settings at runtime so I would suggest that an XML file or the registry are
the best way to go.

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com


"pbcoder" wrote:

Hi,
>
I have been asked to create a solution in a single exe - using C# .NET 3.5.
>
I have found that I can us ILMerge to create a single exe of all of my
Application assemblies.
>
But my question is what to do about settings/config?
>
I have some settings should be settings which should be shared between
instances of the application but these settings could be changed by the user
overtime.
>
This is why I would not use the registy - let the user specify the settings
at first run.
>
Thanks in advance.
>
Lars
Sep 19 '08 #6
Ok - that sounds like a job for the weekend ;-).

I'll see if the my customer might change the requirements for the particular
appllication, since this is going to take some time to acheive.

Thank you for your time Ciaran
Sep 19 '08 #7
On reflection, you could possibly make the app a self extracting zip file
which extracts the EXE and a settings file and then starts the app, then when
you app closes, it can repack the settings file and itself into the exe. You
would probably want a tool for this bit which could be in the zip too.
So the app isnt single exe when running but when not running, it is.
Just an idea for you to think about.
Another option would possibly be to figure out whether you can access any
part of the exe file directly and modify some of it. Possibly add a few bytes
at the end which you can treat as structure storage and write the settings
to. I dont remember if the framework will checksum the exe when it loads it
or if this only happens for strong named assemblies.

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"pbcoder" wrote:
Ok - that sounds like a job for the weekend ;-).

I'll see if the my customer might change the requirements for the particular
appllication, since this is going to take some time to acheive.

Thank you for your time Ciaran
Sep 19 '08 #8
pbcoder wrote:
Hi,

I have been asked to create a solution in a single exe - using C#
.NET 3.5.

I have found that I can us ILMerge to create a single exe of all of
my
Application assemblies.

But my question is what to do about settings/config?

I have some settings should be settings which should be shared
between
instances of the application but these settings could be changed by
the user overtime.

This is why I would not use the registy - let the user specify the
settings at first run.

Thanks in advance.
Uh, why does using the registry preclude letting the user specify the
settings on the first run?

--
--
--John
to email, dial "usenet" and validate
(was jclarke at eye bee em dot net)
Sep 19 '08 #9
Hi Ciaran,

excellent idea about the zip file - i think i will proceed with that idea.

Thank you for your inputs.

"Ciaran O''Donnell" wrote:
On reflection, you could possibly make the app a self extracting zip file
which extracts the EXE and a settings file and then starts the app, then when
you app closes, it can repack the settings file and itself into the exe. You
would probably want a tool for this bit which could be in the zip too.
So the app isnt single exe when running but when not running, it is.
Just an idea for you to think about.
Another option would possibly be to figure out whether you can access any
part of the exe file directly and modify some of it. Possibly add a few bytes
at the end which you can treat as structure storage and write the settings
to. I dont remember if the framework will checksum the exe when it loads it
or if this only happens for strong named assemblies.

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"pbcoder" wrote:
Ok - that sounds like a job for the weekend ;-).

I'll see if the my customer might change the requirements for the particular
appllication, since this is going to take some time to acheive.

Thank you for your time Ciaran
Sep 22 '08 #10
Hi,

Well, using the registry does not preclude the user from specifying settings
at first run - sorry for my english writting - but the way that appliaction
is going to be deployed - means that the registry is the best storage for
settings.

Lars

"J. Clarke" wrote:
pbcoder wrote:
Hi,

I have been asked to create a solution in a single exe - using C#
.NET 3.5.

I have found that I can us ILMerge to create a single exe of all of
my
Application assemblies.

But my question is what to do about settings/config?

I have some settings should be settings which should be shared
between
instances of the application but these settings could be changed by
the user overtime.

This is why I would not use the registy - let the user specify the
settings at first run.

Thanks in advance.

Uh, why does using the registry preclude letting the user specify the
settings on the first run?

--
--
--John
to email, dial "usenet" and validate
(was jclarke at eye bee em dot net)
Sep 22 '08 #11
On Sep 21, 11:05*pm, pbcoder <pbco...@discussions.microsoft.com>
wrote:
Hi Ciaran,

excellent idea about thezipfile - i think i will proceed with that idea.

Thank you for your inputs.

The DotNetZip library makes self-extracting zip files.
http://www.codeplex.com/DotNetZip

But currently there is no way to specify, when you create the SFX,
that you want to execute the exe upon unpack.
Oct 4 '08 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by KennethBohman | last post: by
7 posts views Thread by p | last post: by
8 posts views Thread by deciacco | last post: by
1 post views Thread by Joern Schou-Rode | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.