Announcement

Collapse
No announcement yet.

Need some advanced LUA code...

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

  • Need some advanced LUA code...

    Hi all,

    I just saw "Ahhhhhh, the classics" on the top of the forum and laughed. I'm actually using AMS 6.0, that's right, 6.0 so I hope someone can help me or lead me in the right direction.

    What I would like to do is dig into our Windows Installer .msi package file to grab the ProductVersion property from AMS. Is this possible with LUA code? I'm not sure if I can leverage VBScript in some fashion.

    The reason I want to do this is because I usually just set a global variable manually in AMS to the current version of our software, but I would like to automate things and it would be easier if I could just read this version from the install package at runtime.

    Any help appreciated!

    Again, sorry for being so far behind the times!! :lol

  • #2
    Originally posted by NitLions View Post
    What I would like to do is dig into our Windows Installer .msi package file to grab the ProductVersion property from AMS. Is this possible with LUA code?
    It is, using AutoPlay Media Studio 7.0 or more recent.

    Ulrich

    Comment


    • #3
      Crud! Are there .msi functions build into v7?

      Is there any other way to do this... maybe call a vbscript and return value?

      Sadly, I probably don't have the time to get a new version purchase approved and get everything ready by release time. It's not a killer for me as I can workaround the issue or just keep doing what I'm doing.

      Maybe I could just create a widget to run that would return the value and use File.Run?

      Comment


      • #4
        Crud! Are there .msi functions build into v7?
        Yes, starting with AutoPlay Media Studio 7.0 you have specific MSI actions. You could use
        Code:
        MSI.GetProductProperty(nPackageHandle, "ProductVersion")
        or similar to retrieve the version information from the MSI package.

        Is there any other way to do this... maybe call a vbscript and return value?
        I do not know, sorry. Probably you will need to use this somehow, perhaps in a DLL call...

        Ulrich

        Comment


        • #5
          Originally posted by Ulrich View Post
          I do not know, sorry. Probably you will need to use this somehow, perhaps in a DLL call...

          Ulrich
          I know how to get the property with other code, I just don't know how to return or use the property then in LUI AMS code.

          Comment


          • #6
            You could set an environment variable and get the value with Lua, or write it into a INI or text file...

            Ulrich

            Comment


            • #7
              Hmm, I could go the env. var. route.

              I was going to try to use the DLL.CallFunction to grab the property and return the value. I guess we'll see if that works. Let me know if you foresee any pitfalls.

              Thanks for the input so far!! It's appreciated!!!

              Comment


              • #8
                Here's what I decided to do.. I just created an .exe that will query the .msi and write the ProductVersion property value to Temp registry value. That part seems to be working.

                I'll then read that key in my AMS lua code and....

                What I would like to do is to update the global variable I am currently using. It is currently located in Project -> Actions. I was thinking of doing this on our first dialogs Preload script. Do I need to effect the value in Project -> Actions so its global or in the Preload script can I just set that properties value and it will persist throughout?

                Comment

                Working...
                X