Announcement

Collapse
No announcement yet.

Storing a few packages in different destinations

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

  • Storing a few packages in different destinations

    I have a setup consisting of a few folder references. These folder references belong to separate packages. All folder references are set to the same destination. During setup you can select which package is to be installed, you can only select one. This leads to the installation of only one package in one target folder. I now want to install all packages, this is an additional option. Problem is, since all folder references have the same destination, a selection of all packages would lead to all files being stored in one target directory. Is there a way to define a different destination at runtime ? Lets say package 1 stored in folder 1 and package 2 stored in folder 2 etc.

  • #2
    Yes, what you ask for certainly can be done. Here are is the outline of the steps you need to perform:

    1) Add a "Select Packages" dialog to your project, if you have not already done so, and set it up with your packages.
    2) Move the screen to be shown before the first "Select Install Folder" screen.
    3) Add as many "Select Install Folder" screens as you have packages. In each screen, use a different custom session variable to store the selected folder. The default value is "%AppFolder%", use "%Package1Folder%", "%Package2Folder%" and so on. Customize the text on each screen so it is clear for which package it is.
    4) In the On Preload event script of each of these screens, check with SetupData.GetPackageProperties() if the Install boolean is set for the corresponding package. If it was not selected for installation, jump to the next screen.
    5) Repeat previous step as required until you have this for all packages
    6) Set the destination folder for all files of a certain package to the corresponding destination folder - "%Package1Folder%", "%Package2Folder%" and so on.
    7) Test and check if this works as desired
    8) Finally, add the required script to navigate properly in case the user clicks "Back".

    Ulrich

    Comment


    • #3
      Well thanks Ulrich. I followed your idea and gained some success. I added a few screens and checked in "OnPreload" whether the Install flag is set or not. In case of not set I advance to Screen.Next().
      If it is set I tried to modifiy the folder variable mentioned in "Store in session variable" of the specific screen. This appears not to be recognised by setup.

      example:
      --Which package was selected ?
      bPackageInstall = SetupData.GetPackageProperties("Package xyz").Install;
      if( bPackageInstall == false) then
      SetupData.WriteToLogFile("Package xyz not selected\r\n" );
      Screen.Next();
      else
      SetupData.WriteToLogFile("Package xyz selected, set path\r\n" );
      -- Set Destination Path
      SessionVar.Set("%MY_InstFolder%", "some path");
      end

      Comment


      • #4
        After reading some stuff here I guess that I need to update variables of specific screens. Would that be possible ?
        Is it even possible to modifiy the content of a specific variable of a specific screen ? ThenI could, after "all Packages" was selected, modify the other screens and set the destination path to a different value.

        Comment


        • #5
          Hello, I am not sure what you are doing. You would need to show your project file and installation log, so I could understand the error you are getting.

          In my instruction step 3, I mean this:

          Click image for larger version

Name:	SCRN-2019-03-06-01.png
Views:	96
Size:	28.9 KB
ID:	302691

          In step 6, this:

          Click image for larger version

Name:	SCRN-2019-03-06-02.png
Views:	83
Size:	28.8 KB
ID:	302692

          There shouldn't be the need for setting the contents of the session variable via script, but if you change it, I suggest that you perform this in the On Pre Install event.

          Ulrich

          Comment


          • #6
            again many thanks. your picture to step 6 explained the right thing. Problem solved. Muchas gracias :-)

            Comment

            Working...
            X
            😀
            🥰
            🤢
            😎
            😡
            👍
            👎