Announcement

Collapse
No announcement yet.

Expire

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

  • Expire

    I have not used AMS4 for sometime now, and I built a small project that has a 15 day expiration time set on it and seems to work ok, my question is I ran it on a new machine and noticed that an error box came up telling me, could not get the registry values data, I clicked ok and it ran fine, I then built the same project and changed the expiration to 30 days and the registry value hiddenkey data never changed so the project expiration is still set to 15 days vs the new 30 days. I checked the knowledge base to make sure I did not miss something and could not find anything I missed. I either have missed something or just dont understand or just messed up some place. Any Ideas or explaination would be of great help.

    Thanks

    Fred K

  • #2
    Re: Expire

    Sounds like an error in the actions you're using to read/write from the registry but it would be impossible to discern the error without a copy of the code.

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment


    • #3
      Re: Expire

      I used the code from the knowledge base on expire and I could send you the code thats not a problem if it would be of any help

      Comment


      • #4
        Re: Expire

        This is what it look like

        <IR_ACTIONS_LIST>
        <Action name="Get Date Time">
        <Type>139</Type>
        <Function>0</Function>
        <DTIndentLevel>0</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        <Variable>%Date%</Variable>
        <ReturnType>0</ReturnType>
        <Date>3</Date>
        <Time>0</Time>
        </Action>
        <Action name="Set Value">
        <Type>6</Type>
        <Function>0</Function>
        <DTIndentLevel>0</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        <Variable>%ExpDate%</Variable>
        <Value>FALSE</Value>
        <Evaluate>0</Evaluate>
        </Action>
        <Action name="Get Value Data">
        <Type>72</Type>
        <Function>0</Function>
        <DTIndentLevel>0</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        <Variable>%ExpDate%</Variable>
        <MainKey>2</MainKey>
        <SubKey>HiddenKey</SubKey>
        <Value>Date1</Value>
        <AutoExpand>0</AutoExpand>
        </Action>
        <Action name="IF">
        <Type>200</Type>
        <Function>1</Function>
        <DTIndentLevel>0</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        <Condition>%ExpDate% = FALSE</Condition>
        </Action>
        <Action name="Set Value">
        <Type>6</Type>
        <Function>0</Function>
        <DTIndentLevel>1</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        <Variable>%ExpDate%</Variable>
        <Value>%Date% + 5</Value>
        <Evaluate>1</Evaluate>
        </Action>
        <Action name="Set Value">
        <Type>74</Type>
        <Function>0</Function>
        <DTIndentLevel>1</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        <MainKey>2</MainKey>
        <SubKey>HiddenKey</SubKey>
        <ValueName>Date1</ValueName>
        <ValueData>%ExpDate%</ValueData>
        <DataType>1</DataType>
        </Action>
        <Action name="END IF">
        <Type>201</Type>
        <Function>1</Function>
        <DTIndentLevel>0</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        </Action>
        <Action name="IF">
        <Type>200</Type>
        <Function>1</Function>
        <DTIndentLevel>0</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        <Condition>%Date% &amp;gt;= %ExpDate%</Condition>
        </Action>
        <Action name="Exit">
        <Type>2</Type>
        <Function>0</Function>
        <DTIndentLevel>1</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        </Action>
        <Action name="END IF">
        <Type>201</Type>
        <Function>1</Function>
        <DTIndentLevel>0</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        </Action>
        <Action name="Message Box">
        <Type>5</Type>
        <Function>0</Function>
        <DTIndentLevel>1</DTIndentLevel>
        <Enabled>1</Enabled>
        <ErrorHandling>
        <UserNotificationMode>2</UserNotificationMode>
        <CustomErrorMessage/>
        <OnErrorAction>0</OnErrorAction>
        <JumpToLabel/>
        </ErrorHandling>
        <DialogTitle>Expired</DialogTitle>
        <DialogMessage>This application has expired</DialogMessage>
        <Icon>2</Icon>
        <Variable>%Result%</Variable>
        <DialogType>0</DialogType>
        <DefaultButton>0</DefaultButton>
        </Action>
        </IR_ACTIONS_LIST>

        Comment


        • #5
          Re: Expire

          You have your actions mixed up. First you are setting your %expDate% value to false but then you immediately set it to the value from that read registry action. So why even set it to false to begin with considering you are simply reseting the value with the very next action?

          So anyhow then you have an IF statement testing to see if the value is false but the value can never be false unless the value of that registry key is "false". See what I mean?

          All you need to is spend a little more time experimenting and these things will become apparent to you. Try planning your projects first and then assembling them, this should help you avoid these specific types of errors...

          In this case you need to read th key first and then do the expiry test.

          Corey Milner
          Creative Director, Indigo Rose Software

          Comment


          • #6
            Re: Expire

            Cory thanks, but could you be kind enough to send me a page with the Expire set up as you explained, I tried but I am still missing something, I need to get this done in the next day and I learn best by example. Sorry to be a pain on Sunday.

            Fred K

            Fred K

            Comment


            • #7
              Re: Expire

              No I can't build it *for you* (maybe someone else can) but I can certainly help you figure out how to build it yourself. Think about it logically, you want to:

              1. Check if the key exists and if so get it's value.
              2. If it doesn't exist create it, if it does, do an expiry check.
              3. If it's expired exit application with error message, else, run application.

              Right?

              OK so first try a

              REGISTRY > DOES KEY EXIST

              If it does try a

              REGISTRY > GET VALUE DATA

              else try a

              REGISTRY > CREATE KEY
              REGISTRY > SET VALUE

              To generate an error message and exit try

              DIALOG > MESSAGE BOX
              APPLICATION > EXIT

              Let me know if you're still having troubles once you try those...


              Corey Milner
              Creative Director, Indigo Rose Software

              Comment


              • #8
                Re: Expire

                Thanks Corey I will just do this with NeoBook or Use Juggler to package this its easier.

                Fred K

                Comment


                • #9
                  Re: Expire

                  Actually it's not easier at all but if you don't have the time to do a little experimentation the first couple times you use other software then I guess it would be easier to stick with only the tools you already know... Best of luck.

                  We'll be here if you change your mind...

                  Corey Milner
                  Creative Director, Indigo Rose Software

                  Comment

                  Working...
                  X