Single Exe - No install program - Storing Settings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?cGJjb2Rlcg==?=

    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
  • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

    #2
    RE: Single Exe - No install program - Storing Settings

    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
    try{ Life(); } catch (TooDifficultException) { throw Toys(); }



    "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

    Comment

    • =?Utf-8?B?cGJjb2Rlcg==?=

      #3
      RE: Single Exe - No install program - Storing Settings

      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
      try{ Life(); } catch (TooDifficultException) { throw Toys(); }

      >
      >
      "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

      Comment

      • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

        #4
        RE: Single Exe - No install program - Storing Settings

        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
        try{ Life(); } catch (TooDifficultException) { throw Toys(); }



        "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
        try{ Life(); } catch (TooDifficultException) { throw Toys(); }



        "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

        Comment

        • =?Utf-8?B?cGJjb2Rlcg==?=

          #5
          RE: Single Exe - No install program - Storing Settings

          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
          try{ Life(); } catch (TooDifficultException) { throw Toys(); }

          >
          >
          "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
          try{ Life(); } catch (TooDifficultException) { throw Toys(); }

          >
          >
          "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

          Comment

          • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

            #6
            RE: Single Exe - No install program - Storing Settings

            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
            try{ Life(); } catch (TooDifficultException) { throw Toys(); }



            "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
            try{ Life(); } catch (TooDifficultException) { throw Toys(); }



            "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
            try{ Life(); } catch (TooDifficultException) { throw Toys(); }



            "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

            Comment

            • =?Utf-8?B?cGJjb2Rlcg==?=

              #7
              RE: Single Exe - No install program - Storing Settings

              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

              Comment

              • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

                #8
                RE: Single Exe - No install program - Storing Settings

                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
                try{ Life(); } catch (TooDifficultException) { throw Toys(); }



                "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

                Comment

                • J. Clarke

                  #9
                  Re: Single Exe - No install program - Storing Settings

                  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)


                  Comment

                  • =?Utf-8?B?cGJjb2Rlcg==?=

                    #10
                    RE: Single Exe - No install program - Storing Settings

                    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
                    try{ Life(); } catch (TooDifficultException) { throw Toys(); }

                    >
                    >
                    "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

                    Comment

                    • =?Utf-8?B?cGJjb2Rlcg==?=

                      #11
                      Re: Single Exe - No install program - Storing Settings

                      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)
                      >
                      >
                      >

                      Comment

                      • Cheeso

                        #12
                        Re: Single Exe - No install program - Storing Settings

                        On Sep 21, 11:05 pm, pbcoder <pbco...@discus sions.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.


                        But currently there is no way to specify, when you create the SFX,
                        that you want to execute the exe upon unpack.

                        Comment

                        Working...