Hi, For my installer I need to copy a folder and various files to multiple locations. I was able to do it in a script using a for loop and "*" in the destination path, but I'm hoping I can do it within the bitrock installer without having to call an external program. For example: I tried using a copy action and set the destination directory to:

/Applications/Live*/Contents/AnotherFolder

Hoping that it would copy my files into Contents/AnotherFolder within any folder called "Live 8.2.7" or "Live 7.3" without knowing the exact version number on the user's machine. But instead it seems to take the wildcard character literally and just creates a directory tree called:

/Applications/Live*/Contents/AnotherFolder

Does it work to set up a <regexmatch> within a folder's <destination> or the <destination> of a copy action? An example would be extremely helpful. Thanks so much. -Diane

asked 25 Jun '12, 13:31

ddouglas_KMI's gravatar image

ddouglas_KMI
21446
accept rate: 50%


Nothing wrong with using an external script in your installer in my opinion. I do it all the time. =)

Another option might be to use the InstallBuilder "Run Program" feature and run either "cp" or "xcopy". You're still calling an external program, but you're not utilizing an actual external script. So maybe this will get you far enough away from a script that it would work for your purposes.

Hope this helps!

-Jordan

link

answered 28 Mar '13, 19:18

utdream's gravatar image

utdream
1
accept rate: 0%

You could also use InstallBuilder built-in actions using an <unpackDirectory> instead of letting the installer automatically unpack the files:

<component>
   <name>yourComponent</name>
    ...
   <folderList>
      <name>yourFiles</name>
      <distributionFileList>
          <distributionDirectory origin="path/to/yourdir"/>
      </distributionFileList>
      <ruleList>
            <!-- This is never true, so the folder is not automatically unpacked -->
            <isTrue value="0"/>
      </ruleList>
   </folderList>
   <postInstallationActionList>
         <!-- Get list of Destination Directories -->
         <setInstallerVariableFromScriptOutput>
            <name>dirs</name>
            <exec>find</exec>
            <execArgs>/Applications -name 'Live* ' -maxdepth 1 -exec echo \"{}\" \;</execArgs>
            <workingDirectory></workingDirectory>
         </setInstallerVariableFromScriptOutput>
         <!-- Iterater over the directories, unpacking -->
         <foreach variables="destination" values="${dirs}">
             <actionList>
                  <unpackDirectory>
                    <component>yourComponent</component>
                    <destination>${destination}/Contents/AnotherFolder</destination>
                    <folder>yourFiles</folder>
                    <origin>yourdir</origin>
                 </unpackDirectory>
             </actionList>
          </foreach>
   </postInstallationActionList>
</component>
link

answered 01 Apr '13, 04:47

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×7
×3
×1
×1

Asked: 25 Jun '12, 13:31

Seen: 1,756 times

Last updated: 01 Apr '13, 04:47