Announcement

Collapse
No announcement yet.

SetupData.GetPackageProperties()

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

  • SetupData.GetPackageProperties()

    Hi All,

    Does it make sense to write this statement

    Code:
    if SetupData.GetPackageProperties("wpf").Install then
        ...
    endif
    in the OnPreUninstall action?

    We have no screens to check/uncheck these options during uninstall. What value will this call return?

    Thanks,

    Alberto

  • #2
    From a quick test, that code/logic appeared to work and returned the value from the original install (the package's install state). Alternatively, you could set your own session variable and check that value in the uninstall.

    Darryl

    Comment


    • #3
      Wonderful, thanks.

      Alberto

      Comment


      • #4
        Hi.

        if SetupData.GetPackageProperties("ABC").Install then
        ... end
        So where the result is stored?

        Comment


        • #5
          Basically in Select Packages/Next I need to check if the package (named f/e ABC) has been selected by user to be installed and based on that (if install=true) do additional actions.

          So I guess I need to use tAAA = SetupData.GetPackageProperties("ABC"); which creates a table tAAA. But what is the correct way of checking if the Install parameter is true?

          if SetupData.GetPackageProperties("wpf").Install then ...looks like an easier solution but it is not obvious where to look for the actual result... or does the above means that if install=true then ?

          Comment


          • #6
            Guys, I would extremely appreciate if someone could point me to the right direction. :-)

            Comment


            • #7
              I am actually unsure what your doubt is here. SetupData.GetPackageProperties("name") returns a table, and SetupData.GetPackageProperties("name").Install is one field of that table. There is no need to store the table anywhere if you just want to check if the field (which is a boolean) is true or false. This is how you check if the boolean is true or false:
              Code:
              if SetupData.GetPackageProperties("name").Install then
                -- the package was selected, do something
              else
                -- the package was not selected, do something else or nothing
              end
              Of course, you could store the result, in case you want to use some other information retrieved by the call to SetupData.GetPackageProperties(), like this:
              Code:
              local nAdditionalDiskSpace = 0;
              local tPackage = SetupData.GetPackageProperties("name");
              if tPackage.Install then
                -- the package was selected, do something
                nSpaceNeeded = nSpaceNeeded + tPackage.AdditionalDiskSpace;
              else
                -- the package was not selected, do something else or nothing
              end
              if (nSpaceNeeded > 0) then
                Dialog.Message("", "Will need ".. nSpaceNeeded .. " extra bytes");
              end
              Does that makes sense?

              Ulrich

              Comment


              • #8
                Thanks Ulrich.
                Apparently I had tried the "easy" version but with the wrong package ID. [']

                But thanks for explaining the table-related part, this will definitely be helpful and too bad I couldn't find such an explanation in the manual.

                Comment

                Working...
                X