Announcement

Collapse
No announcement yet.

Writing Input Serial Number to a File in AppFolder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Writing Input Serial Number to a File in AppFolder

    I am creating a simple Setup and just added Security Dialog Box with 100 predefined Keys with Built-In, so that in order to install setup correct serial code will be required. Now what I want is, when a user enter correct serial key and press next button then, the same input key should be stored in a Text file in AppFolder.

  • #2
    Cool. What is your question?

    Ulrich

    Comment


    • #3
      Originally posted by Ulrich View Post
      Cool. What is your question?

      Ulrich
      "Now what I want is, when a user enter correct serial key and press next button then, the same input key should be stored in a Text file in AppFolder."

      How can I make my setup to write input serial key to a text file in target (installation directory) i.e %AppFolder%

      Comment


      • #4
        The serial number is stored in a session variable, and the name is given in the screen, which is %SerialNumber% by default but of course you can edit as desired. The screen has a Help button which links to two examples for working with information typed into an Edit field, check them out.

        For writing text files, use TextFile.WriteFromString() or TextFile.WriteFromTable() …

        Ulrich

        Comment


        • #5
          Originally posted by Ulrich View Post
          The serial number is stored in a session variable, and the name is given in the screen, which is %SerialNumber% by default but of course you can edit as desired. The screen has a Help button which links to two examples for working with information typed into an Edit field, check them out.

          For writing text files, use TextFile.WriteFromString() or TextFile.WriteFromTable() …

          Ulrich
          Well I appreciate your help but it is not working.

          I'm unable to store user defined serial key to an external file.

          Comment


          • #6
            Attach your project file, so we can see the current code and tell you what needs to be corrected.

            Ulrich

            Comment


            • #7
              This is the method which you suggested, I have been working on it for a long to get Input Serial Number instead of Hello World Text.
              Code:
              TextFile.WriteFromString(SessionVar.Expand("%AppFolder%\\yourserialkey.txt"), "Hello World", false);
              Seems like this works for predefined text only to write in specific file, yet I'm not able to catch Serial Number which user put on Edit Field and then send same into "yourserialkey.txt".

              Comment


              • #8
                Originally posted by Ulrich View Post
                Attach your project file, so we can see the current code and tell you what needs to be corrected.

                Ulrich
                Here is the file.

                Attached Files

                Comment


                • #9
                  In your On Post Install event script, you placed this:
                  Code:
                  TextFile.WriteFromString("%AppFolder%\\yourserialkey.txt", "Hello, world.", false);
                  This is of course incorrect, and you should read "How do session Variables work?" in our FAQ to understand why.
                  Something like this would work properly, assuming that you want only the original key stored in the text file, and nothing more:
                  Code:
                  TextFile.WriteFromString(SessionVar.Expand("%AppFolder%\\yourserialkey.txt"), SessionVar.Expand("%SerialNumber%"), false);
                  Ulrich

                  Comment


                  • #10
                    Originally posted by Ulrich View Post
                    In your On Post Install event script, you placed this:
                    Code:
                    TextFile.WriteFromString("%AppFolder%\\yourserialkey.txt", "Hello, world.", false);
                    This is of course incorrect, and you should read "How do session Variables work?" in our FAQ to understand why.
                    Something like this would work properly, assuming that you want only the original key stored in the text file, and nothing more:
                    Code:
                    TextFile.WriteFromString(SessionVar.Expand("%AppFolder%\\yourserialkey.txt"), SessionVar.Expand("%SerialNumber%"), false);
                    Ulrich
                    Thank You so much Sir.
                    At some point I reach to this below code: But guess what, I didn't add SessionVar.Expand with target file.
                    Code:
                    TextFile.WriteFromString("%AppFolder%\\yourserialkey.txt"), SessionVar.Expand("%SerialNumber%"), false);
                    Thanks once again.

                    Comment

                    Working...
                    X