TheRocket
Posts: 31
Joined: Thu Jul 26, 2012 6:55 pm

New files added to folder with "Condition Files" doesn't inherit conditions

Tue Oct 27, 2020 4:54 am

The following issue was reproduced with Version 17.6 (C087F2E6)

Create a new Enterprise project.
Create a new Parameter "TEST" with default value "Y"
Create a new folder "test" under Application Folder.
Add 2 files to the folder.
On the "test" folder, right-click and select "Condition Files".
Put a condition like this: TEST = "Y"
Save the project. Notice in the Aip project, the files are properly conditioned.
When checking the condition on the "test" folder, you see the appropriate condition: TEST = "Y"
In the "test" folder, add a new file.
Save the project. Notice in the Aip project, the new file is not conditioned.
When checking the condition on the "test" folder, it is reset to "test_dir".

I would suggest that if a folder have a condition (or all files in the folder have the same condition), adding new files would also be conditioned, to keep consistency. Optionally, a prompt could be shown to selection a condition if there is multiple conditions for the same folder.

Note also that we can do a right-click on a file, but there is no menu "Condition file". The icon "Condition Files" is available only in the toolbar.
It could be a nice idea to add this menu "Condition file" when doing a right click on a file.

Thanks!

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: New files added to folder with "Condition Files" doesn't inherit conditions

Fri Oct 30, 2020 2:29 pm

Hello,

Thank you for the provided test-case.

Unfortunately, I was not quite able to replicate this behavior on my machines.

When adding the third file, I can see that it inherits the condition set for the folder.

Could you please double check this and make sure you did not forget a step?

Here are the steps I took:

- new project

- in "Install Parameters" page, create the following property:

Name: TEST
Value: Y


- in "Files and Folders" page --> new Regular folder --> add two files --> condition the folder --> save the project --> close the project

- reopen the project --> add a new file --> checked its' condition and noticed it is set accordingly --> save the project --> close the project

- reopen the project to check once again for the condition and the same as above happened

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

TheRocket
Posts: 31
Joined: Thu Jul 26, 2012 6:55 pm

Re: New files added to folder with "Condition Files" doesn't inherit conditions

Tue Nov 10, 2020 1:08 am

Hi Catalin,

Sorry it seems harder than I though to reproduce.

- Create a new Enterprise project.
- Create a new Parameter "TEST" with default value "Y"
- Create a new folder "test", child of the Application Folder.
-- Create a new folder "test2", child of the "test" folder.
- Add 2 files to the folder "test".
- On the "test" folder, right-click and select "Condition Files".
-- Put a condition like this: TEST = "Y"
- When checking the condition on the "test" folder, you see the appropriate condition: TEST = "Y"
- In the "test2" folder, add a new file, notice it's condition is test2_dir
- In the "test" folder, add a new file, notice this file condition is test_dir

Further more:
- On Folder "test", change condition to TEST <> "Y"
- Notice all subfolders and files changed conditions
- In the "test" folder, add a new file, notice this file condition is test_dir

Seems like the subfolder causes issues for the next files added in.
Even if you reset the conditions on the parent "test" folder, it propagates downward correctly, but the sub folder still causes issues adding new files.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: New files added to folder with "Condition Files" doesn't inherit conditions

Thu Nov 12, 2020 4:31 pm

Hello,

Thank you for your followup on this.

At first, I did not manage to reproduce this, but in the end I was able to do so.

The reason was the fact that I was adding the same file type (e.g. .TXT files) in the folder and everything worked as expected. Once I've added a new file type (e.g. a .DLL file), I managed to reproduce it.

Interestingly enough, if the UI is used, the condition seems to be reset. However, if you have a look over the "Organization" page, you can notice that the files earlier conditioned are still conditioned.
one.png
one.png (84.87KiB)Viewed 4915 times
two.png
two.png (73.76KiB)Viewed 4915 times
I will forward this to our development team for further investigations.

Once again, thank you for the provided test-case and for bringing this to our attention!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: New files added to folder with "Condition Files" doesn't inherit conditions

Fri Nov 13, 2020 2:50 pm

Hello,

As a followup to my last thread - I have further discussed this with our development team and this is the intended behavior, not a bug. Please allow me to explain why.

The only way to condition files in Windows Installer is to edit the condition of its' component.

The option of "Condition Files", what actually does is to edit the condition of the components of selected files or directory.

Advanced Installer creates automatically components for files and directories using best practices recommended by Microsoft so TXT files from a directory are using the same component but DLLs, EXE get a component dedicated to them.

So when you add a TXT file in a directory that already has a TXT file the new one lands in an existing component which has condition set on component.

When you add a DLL file this gets a new component with default condition which is empty.

This UI option is an action not a directory setting, therefore it is correct that newer adds to not be affected by previous actions.

Hope the explanation helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

TheRocket
Posts: 31
Joined: Thu Jul 26, 2012 6:55 pm

Re: New files added to folder with "Condition Files" doesn't inherit conditions

Thu Nov 19, 2020 8:58 pm

Thanks Catalin,

That explains the behaviors I've seen while adding files / directories to project.

I'll be using more the "Condition files" option on each files after adding them to ensure they are ok
and also use the folder condition to re-apply conditions to all files if needed.

I would suggest to add an optional column in the files list , "File Condition" so we could have an overview of all files conditions in a directory, to ensure we are not missing one. I guess this would be a very low priority.

Alternatively, an icon overlay on the folder or file to indicate it have a special condition, which would quickly indicate we must take extra care when adding new files to this directory / file list.

Thanks!!

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: New files added to folder with "Condition Files" doesn't inherit conditions

Fri Nov 20, 2020 2:15 pm

You are always welcome!

I am glad things are more clear now.

In what regards your suggestions, I will forward them to our development team.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: New files added to folder with "Condition Files" doesn't inherit conditions

Fri Nov 20, 2020 2:41 pm

Hello,

As a followup to my last thread:

I've discussed this with the developer and we will add the requested column in a future version of Advanced Installer.

However, an overlay is unfortunately not possible because we have already reached the system limit. Additionally, it is pretty hard to make any sense from a tiny picture anyway.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: New files added to folder with "Condition Files" doesn't inherit conditions

Fri Jan 29, 2021 4:30 pm

Hello,
I would suggest to add an optional column in the files list , "File Condition" so we could have an overview of all files conditions in a directory, to ensure we are not missing one. I guess this would be a very low priority.
This improvement has been added in Advanced Installer 17.9, released on January 25th, 2021.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”