Searcher64
Posts: 19
Joined: Sun Jan 22, 2012 3:29 am

Same Files in Same Directory Features

Hello,

So my problem is trying to have only 1 file installed based on the feature selected out of several files that has the same name. A bit difficult to explain, so I'll try to use the following example.

Here are the files with the same names.

Application Folder\Option Files\Option 1\example.txt
Application Folder\Option Files\Option 2\example.txt
Application Folder\Option Files\Option 3\example.txt
Application Folder\Option Files\Option 4\example.txt
Application Folder\Option Files\Option 5\example.txt

There are 5 options that the user can choose to install, and they can choose which on a custom dialog with radio buttons that I created using this wiki page (http://www.advancedinstaller.com/user-g ... ature.html). They each have their own feature in the Organization page. Now the real problem is having the correct directory for them to install into. The CORRECT directory for example.txt to be installed in is

Application Folder\Option\example.txt

But I can't add all the example.txt files in Application Folder\Option or else it will ask me if I want to overwrite the last one since they all have the same name, so I have resorted to adding them in different folders for organization. I tried changing "Directory" in Organization -> Feature -> Feature Properties but if I try to change it, it just gives me the error "Only non-system folders and public properties can be selected!" The file's name cannot be changed as it's required for the software to function correctly. I would appreciate any help, thank you.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Same Files in Same Directory Features

Hello,

Here's the How do I install two files with the same name in the same folder? article to help you with this.

Let us know if you have any questions.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Searcher64
Posts: 19
Joined: Sun Jan 22, 2012 3:29 am

Re: Same Files in Same Directory Features

Okay thanks, I seem to have gotten that working but I'm not sure yet as I'm having trouble with the VBS script as stated in the wiki page I posted in the first post (http://www.advancedinstaller.com/user-g ... ature.html).

The wiki page seems to be outdated with its terms, such as
add the VBS file as an "Attached Custom Action" without sequence
I assumed that this was "Launch attached file without sequence." It seemed wrong though, as it was asking for a file on my current computer. If this is the case, how is the installer able to execute the VBS script that's not existent or installed on their computer? If I try to go to the next dialog when the script is supposed to run, the message "There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor." If I try to add the VBS script to the install and use custom action "Launch file or open URL" on the VBS, it gives a runtime error saying "Object required: 'Session'"

Is it supposed to be something else than "launch attached file without sequence?" I have a feeling I'm missing something.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Same Files in Same Directory Features

You're welcome, glad to help.

"Attached Custom Action" indeed means adding "Launch attached file" without sequence. We'll update the user guide.

With this custom action you only need to add its resource once when including it at development time. It will be attached to the built package and the user will not be prompted during the installation.

However, starting with our next version we've implemented some predefined functionality to make user lives easier regarding this. There won't be any need for any .VBS custom actions.

If you want to wait it should be out by the end of next week.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Searcher64
Posts: 19
Joined: Sun Jan 22, 2012 3:29 am

Re: Same Files in Same Directory Features

mihai.petcu wrote:You're welcome, glad to help.

"Attached Custom Action" indeed means adding "Launch attached file" without sequence. We'll update the user guide.

With this custom action you only need to add its resource once when including it at development time. It will be attached to the built package and the user will not be prompted during the installation.

However, starting with our next version we've implemented some predefined functionality to make user lives easier regarding this. There won't be any need for any .VBS custom actions.

If you want to wait it should be out by the end of next week.

All the best,
Mihai
Alright, but the problem with the VBS script still persists, here's an image
Image

It happens when I click the Next button, regardless of whether or not I chose any options
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Same Files in Same Directory Features

You can get that error if the custom action fails to execute for some reason. Unfortunately we cannot help you debug it if you personalized it, but you can use MsgBox occurrences to keep track of property values. Another method is described in the Debug a vbs script thread.

The article functionality has been tested and if you followed it step by step an kept the logic it should work as expected. If you want to implement it instead of the new soon to be released functionality, please send us the project file(.AIP) to support at advancedinstaller dot com so we can see what's wrong.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”