Loading ...
Sorry, an error occurred while loading the content.
 

Re: [libertybasic] Protect file

Expand Messages
  • Stefan Pendl
    ... Don t call it score.txt , but resources.dll for instance. Get the access, modification and creation times before you alter the file and apply the old ones
    Message 1 of 5 , Jan 25, 2013
      Am 25.01.2013 07:19, schrieb green8819:
      > I want to keep a score.txt file together with my bas file in a folder. I can Create Application with the bas so that a user can run it, but not able to modify it.
      >
      > I can encrypt the .txt file so that the progrm can update scores, but a user cannot alter the scores.
      >
      > But the user can right-cliclk\delete or cmd\kill it. Any way to prevent this?
      >

      Don't call it "score.txt", but resources.dll for instance.

      Get the access, modification and creation times before you alter the
      file and apply the old ones after altering it, so the user doesn't know
      that the file has changed.

      In addition you can hide it and mark it as system file, but there is no
      way to never delete it.


      --
      Stefan Pendl
      http://stefanpendl.runbasichosting.com/

      LB 4.04 Pro ... http://www.libertybasic.com/assist.html
      LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

      LB Community Wiki .............. http://basic.wikispaces.com/
      LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
      LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

      Books at http://www.lulu.com/ and http://www.amazon.com/
      Alyce Watson ... APIs for Liberty BASIC
      Carl Gundel .... Beginning Programming with Liberty BASIC

      Windows 7 Home Premium 64-bit SP1
      AMD Turion X2 RM-70 2GHz, 4GB RAM
    • green8819
      Thank you, Stefan. I try some non-LB programs. The ones I don t wan to keep, I uninstall. But sometimes one or two files still remain. I wonder how they do
      Message 2 of 5 , Jan 25, 2013
        Thank you, Stefan.

        I try some non-LB programs. The ones I don't wan to keep, I uninstall. But sometimes one or two files still remain. I wonder how they do that.

        I want to show that there are no hidden files in my program. At the same time, I do not want to leave behind stubborn files after user has uninstalled.

        Thanks anyway.

        --- In libertybasic@yahoogroups.com, Stefan Pendl wrote:
        >
        > Am 25.01.2013 07:19, schrieb green8819:
        > > I want to keep a score.txt file together with my bas file in a folder. I can Create Application with the bas so that a user can run it, but not able to modify it.
        > >
        > > I can encrypt the .txt file so that the progrm can update scores, but a user cannot alter the scores.
        > >
        > > But the user can right-cliclk\delete or cmd\kill it. Any way to prevent this?
        > >
        >
        > Don't call it "score.txt", but resources.dll for instance.
        >
        > Get the access, modification and creation times before you alter the
        > file and apply the old ones after altering it, so the user doesn't know
        > that the file has changed.
        >
        > In addition you can hide it and mark it as system file, but there is no
        > way to never delete it.
        >
        >
        > --
        > Stefan Pendl
        > http://stefanpendl.runbasichosting.com/
        >
        > LB 4.04 Pro ... http://www.libertybasic.com/assist.html
        > LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe
        >
        > LB Community Wiki .............. http://basic.wikispaces.com/
        > LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
        > LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/
        >
        > Books at http://www.lulu.com/ and http://www.amazon.com/
        > Alyce Watson ... APIs for Liberty BASIC
        > Carl Gundel .... Beginning Programming with Liberty BASIC
        >
        > Windows 7 Home Premium 64-bit SP1
        > AMD Turion X2 RM-70 2GHz, 4GB RAM
        >
      • styskul
        Many installation packages are set by default to not remove files that have been updated since the program was installed. Also, if a file is marked as shared
        Message 3 of 5 , Jan 25, 2013
          Many installation packages are set by default to not remove files that have been updated since the program was installed. Also, if a file is marked as shared it might not be removed on uninstallation. Finally, I believe some install packages will simply let you mark a file as "do not remove" on uninstall. All depends on what you use to package up your installation.

          Eric




          ----- Original Message -----
          From: "green8819" <mike4612@...>
          To: libertybasic@yahoogroups.com
          Sent: Friday, January 25, 2013 8:37:14 AM
          Subject: [libertybasic] Re: Protect file






          Thank you, Stefan.

          I try some non-LB programs. The ones I don't wan to keep, I uninstall. But sometimes one or two files still remain. I wonder how they do that.

          I want to show that there are no hidden files in my program. At the same time, I do not want to leave behind stubborn files after user has uninstalled.

          Thanks anyway.

          --- In libertybasic@yahoogroups.com , Stefan Pendl wrote:
          >
          > Am 25.01.2013 07:19, schrieb green8819:
          > > I want to keep a score.txt file together with my bas file in a folder. I can Create Application with the bas so that a user can run it, but not able to modify it.
          > >
          > > I can encrypt the .txt file so that the progrm can update scores, but a user cannot alter the scores.
          > >
          > > But the user can right-cliclk\delete or cmd\kill it. Any way to prevent this?
          > >
          >
          > Don't call it "score.txt", but resources.dll for instance.
          >
          > Get the access, modification and creation times before you alter the
          > file and apply the old ones after altering it, so the user doesn't know
          > that the file has changed.
          >
          > In addition you can hide it and mark it as system file, but there is no
          > way to never delete it.
          >
          >
          > --
          > Stefan Pendl
          > http://stefanpendl.runbasichosting.com/
          >
          > LB 4.04 Pro ... http://www.libertybasic.com/assist.html
          > LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe
          >
          > LB Community Wiki .............. http://basic.wikispaces.com/
          > LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
          > LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/
          >
          > Books at http://www.lulu.com/ and http://www.amazon.com/
          > Alyce Watson ... APIs for Liberty BASIC
          > Carl Gundel .... Beginning Programming with Liberty BASIC
          >
          > Windows 7 Home Premium 64-bit SP1
          > AMD Turion X2 RM-70 2GHz, 4GB RAM
          >




          [Non-text portions of this message have been removed]
        • Stefan Pendl
          ... uninstall. But sometimes one or two files still remain. I wonder how they do that. ... same time, I do not want to leave behind stubborn files after user
          Message 4 of 5 , Jan 25, 2013
            > Am 25.01.2013 14:37, schrieb green8819:> Thank you, Stefan.
            > >
            > > I try some non-LB programs. The ones I don't wan to keep, I
            uninstall. But sometimes one or two files still remain. I wonder how
            they do that.
            > >
            > > I want to show that there are no hidden files in my program. At the
            same time, I do not want to leave behind stubborn files after user has
            uninstalled.
            > >
            >
            Am 25.01.2013 15:29, schrieb epankoke@...:
            > Many installation packages are set by default to not remove files that have been updated since the program was installed. Also, if a file is marked as shared it might not be removed on uninstallation. Finally, I believe some install packages will simply let you mark a file as "do not remove" on uninstall. All depends on what you use to package up your installation.
            >
            > Eric
            >

            As Eric says, some installers prevent removing of files not added by the
            installer. This is left over from the days where the bad habit was
            allowed to alter files in the installation folder by the user.

            In general users don't need to alter files in or add files to the
            installation folder, this is all a task for the installer only.

            The developer must take care of all files being removed from the
            installation folder, they may ask to remove files from the users
            application data folder if they like.

            Developers are often too lazy to clean up entirely when the user decides
            to remove the application from his system.

            If you ever used an install maker to create an installer and verified
            that it removes the application without a trace, then you know how to do
            it properly.

            For instance, Inno Setup has the ability to remove only files installed
            by the installer enabled by default, so one needs to add an additional
            line of code to clear the system from the whole installation folder
            despite of changes and additional files.

            On the other hand NSIS doesn't support removing only installed files out
            of the box, so you simply remove the whole folder and everything is gone.

            Sure both ways have their pros and cons, but if the installer is written
            to allow only installing into an empty folder or into a previous
            installation, then there is nothing wrong with removing the whole
            installation folder without further checks.

            The only problem remaining is the user, who must be guided to avoid
            stupid behavior.


            --
            Stefan Pendl
            http://stefanpendl.runbasichosting.com/

            LB 4.04 Pro ... http://www.libertybasic.com/assist.html
            LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

            LB Community Wiki .............. http://basic.wikispaces.com/
            LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
            LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

            Books at http://www.lulu.com/ and http://www.amazon.com/
            Alyce Watson ... APIs for Liberty BASIC
            Carl Gundel .... Beginning Programming with Liberty BASIC

            Windows 7 Home Premium 64-bit SP1
            AMD Turion X2 RM-70 2GHz, 4GB RAM
          Your message has been successfully submitted and would be delivered to recipients shortly.