Announcement

Collapse
No announcement yet.

How to install into custom folder under C:\?

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

  • How to install into custom folder under C:\?

    Hello,


    I have unexpected difficulties setting the Install directory in Folders dialog.

    I want my files to be installed into, let's say, C:\PB\utest\mvmnt32 (all subfolders already exist on users' machines). Surprisingly, there is no C:\ drive among seven common system folders that are by default displayed in the dialog. Clicking on "Other Folders" does not offer anything that would represent C:\ from where I could build the whole target path and assign INSTALLDIR Folder ID to "mvmnt32" folder.
    Help mentions "System Drive" global variable but I'm not sure how to reference it from here.
    Could you help me please?


    Many thanks!
    Leon

  • #2
    Hello,

    here is a procedure to install your files into a generic folder, like "C:\MyTargetFolder\Blah".
    1. Create a new folder under SourceDir (Project > Folders > Add), and name it "TargetFolder", with an ID "FOLDER_0001" (or whatever number is suggested). Keep the ID in all caps.
    2. If you have an InstallDirDlg in your dialogs, open it (Project > Dialogs). Double-click the PathEdit field where the destination folder will be shown.
    3. Uncheck the "Indirect" option, and the the Property name to "FOLDER_0001" (or what was used in step 1).
    4. Now double-click the "Change..." button to browse for the destination folder of the data files. Go to the Published Events tab, and set the value of the _BrowseProperty to "FOLDER_0001".
    5. Now add a Custom Action, selecting the option "Set Folder". On the Settings tab, set the Folder ID to "FOLDER_0001", and the value to the folder you wish to use, like "C:\MyTargetFolder\Blah". On the Attributes tab, add a "InstallUISequence", with timing for example to "before WelcomeDlg". This will assure that the contents of FOLDER_0001 is set to "C:\MyTargetFolder\Blah" before the Destination Folder dialog is first displayed.
    6. Set the destination folder for the files in your installer to FOLDER_0001, by double clicking the file, and setting the correspondent field on the General tab.
    7. Build the installer and test everything.

    Ulrich

    Comment


    • #3
      Sorry, to continue this very old thread, but my question fits very good to the topic. At our installer, the first dialog after the Welcome dialog is a dialog, where the customer can select the product that he has purchased. Depending on the type of product he wants to install the software for, I would like to change the installation path.

      My problem now: At the Timing value of the Attribute tab of the Custom action, it seems that I only have the general dialogs like WelcomeDlg available. But I would need to have the Action executed between our ProductSelectionDlg and the SetupTypeDlg and none of these dialogs is available there. When I directly put the name of the dialog in, I get a linker error:
      error LGHT0094 : Unresolved reference to symbol 'WixAction:InstallUISequence/ProductSelectionDlg'

      How can I configure our dialogs so that they are available for the timing of the custom action?

      Comment


      • #4
        You could call your CA in the Published Events of the Next button, before jumping to the next dialog (i.e., before Event: NewDialog).

        Ulrich

        Comment


        • #5
          Thanks, that worked!

          Comment


          • #6
            New to MSI Factory -
            Followed these instructions - works great
            Now I need to be able to edit a LUA script used in Setup Factory to get the installDirectory.
            have tried many of the MSI actions from the script editor in SetupFactory- also returns nil.

            Any help is appreciated.

            Comment


            • #7
              This should work:

              Code:
              local sInstallPath = MSI.GetProperty(_hInstall, "INSTALLDIR");
              Of course, this assumes that the Custom Action is timed to be executed after this Property was defined.

              Ulrich

              Comment


              • #8
                not exactly sure what i have wrong. I am trying to create 3 folders within the directory that the application is installed in.
                for the custom action timing I have added a ExecuteInstallSequence set to After/InstallFinalize.

                getting a nil value error on the .Print statement.


                Code:
                local sInstallPath = MSI.GetProperty(_hInstall, "INSTALLDIR");
                
                nResult = Debug.SendToFile("C:\\MyLog.txt", true);
                Debug.Print(sInstallPath);
                
                Folder.Create(sInstallPath.."\\Forms\\");
                Folder.Create(sInstallPath.."\\Images\\");
                Folder.Create(sInstallPath.."\\Temp\\");
                Thanks

                Comment


                • #9
                  There is no Debug.SendToFile() in MSI Factory. Please refer to the product documentation.

                  Ulrich

                  Comment

                  Working...
                  X