cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gcggcg
Level 4

Bug or Feature

I ran into a behavior in IS today that looks like a bug but I'm not sure. I'm using a Basic MSI project type and I don't have SP1. Here's what I found:

I have a component that has a dynamic link to a folder and I'm specifying to include *.* and exclude a specific file. The folder also contains another folder and that folder is empty. When I look on the Files and Folders view, the empty folder shows up as I would expect. However, when I do the install, the empty folder is not created on the destination machine. This might or might not be acceptable, but ...

What I found is that if I change the configuration of the dynamic link such that it does not exclude any files ("Exclude files with the following patterns:" is left blank), then the empty folder is created on the destination machine.

This doesn't seem right to me but am I missing something? I want the empty folder to be created on the destination machine and I also want to exclude a file. If the above behavior is correct, is there a way to achieve what I want?

Thanks!
Labels (1)
0 Kudos
(4) Replies
skolte
Level 7

Not sure if the behavior you see is a bug but if you need to create an empty folder,
1. simply create a new component and add an empty folder to it

or

2. Select the component that has the dynamically linked files, click on Files, right click in Files area and select 'Add' and select the empty folder. Now InstallShield would explicitly create the folder.

You might want to add the folder's name to 'exclude list' in Dynamically linked files list so that InstallShield doesn't attempt to create it again.
0 Kudos
gcggcg
Level 4

Hi Skolte,

Thanks for the reply!

I might not have explained the problem very well. The behavior that the client wants is to dynamically link to a folder and (dynamically) "include all subfolders". They want empty as well as non empty folders that exist in the "tree" to be created on the target machine. Over time, they want to be able to add additional folders into this tree - some empty, some not - and have all added folders (empty and not empty) be created on the target machine.

So I could go in right now and explicitly create the empty folders that they currently have, as you suggested (though this goes against their wish to have all subfolders created dynamically). This would solve the problem for right now. But, if they add some new empty folders into the tree in the future, they'd have to modify the project to explicitly create them every time they did that rather than just do a rebuild.

The behavior that I described in the original post just seems wrong to me.

So if you have any additional thoughts I'd appreciate hearing them.

Thanks again for taking the time and effort to respond - I appreciate it!
0 Kudos
skolte
Level 7

I do see the behavior that you described.

I created a folder with two text files of 0 bytes and created two sub folders. When I installed the sample app, it installed the files of 0 bytes but did not create the empty sub-folders.
I can think of two solutions to your problem if you don't want to change your InstallShield project each time.

Solution 1:
I think if you ask your client to always place an empty readme.txt file (0 bytes) inside the folder, every time they create a new folder. That will be much easier solution than you making a change to InstallShield project and adding the folder manually to a component.

Solution 2:
The other much cleaner option is using InstallScript to copy over the files to target dir (XCopyFile). That way you can include and exclude files as you may wish.

In both the approaches, though you don't make any change to InstallShield project, I think you will still need to build the installer each time the folder structure changes so that Installer notes the changes and adds those files/folder appropriately.
0 Kudos
gcggcg
Level 4

Hi Skolte,

I appreciate the help! I'm thinking that perhaps the 0 byte files will be the solution that best matches the requirements in this case. And I agree that a new build will need to be done each time changes are made to the build environment. We were just looking for a way to not have to actually modify the project itself, which both of those solutions seem to accomplish.

If you want to experiment a little more with the behavior, the situation I set up was to create a folder with two 0 byte .txt files in it, say one.txt and two.txt. I also placed an empty sub folder in it. Then I created a component that dynamically linked to the top folder and specified in the dynamic link dialog box to include *.*. That worked fine and, on the target machine, I got both one.txt and two.txt and the empty folder (as I had expected). Then I went back to the dynamic link dialog box and, in the "exclude files with this pattern" area, I entered one.txt . What I then got on the target machine was the file two.txt but the empty folder wasn't created. What I had expected was to see two.txt and the empty folder since the exclusion was only for one.txt.

Thanks again - you've been very helpful on a couple of issues I've had.
0 Kudos