We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

atanc
Posts: 7
Joined: Thu Apr 23, 2020 12:21 am

Component property condition

Hi,

I am trying to conditionally overwrite a certain file during installation but am running into issues. On the Organisation tab, I select the file in the Features and Component list and then on the Component properties pane, I have the following condition...

( MYPROP_ABORT = "0" ) AND ( MYPROP_FILE_PRESENT = "1" )

Note: These two properties are set via a VBScript which is executed by a Custom Action.

What I'm finding is that regardless of the values assigned to those properties by the VBScript, the file is NEVER overwritten.

Is this possible to achieve? Am I running into an evaluation time issue? (At what point are those conditions evaluated?)

Thanks in advance,
Anthony
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Component property condition

Hello Anthony,

Please make sure the component does not have the "Never Overwrite" attribute set.

Additionally, please make sure that the component resource (the file itself) does not have the "Do not overwrite existing file" attribute set. This can be checked by going to "Files and Folders" page --> selecting your file --> double click on it --> "Operations" tab.

Also, if the file is a non-versioned resource (e.g. a txt file), I would advise using the "Always overwrite existing file".

Please let me know if this helps. If not, please give me a test-case which I can follow in order to reproduce this issue.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
atanc
Posts: 7
Joined: Thu Apr 23, 2020 12:21 am

Re: Component property condition

Hi Catalin,

Thanks for your reply. I checked the overwrite properties and all were were set correctly.

I have just managed to solve the issue however and it was to do with evaluation timing... I was running my custom action after the "Paths resolution" step. I ended up moving this prior to the ""Paths resolution" > "Cost finalisation" step and everything now works (I assume this is the step which determines which components will be installed?).

So, providing there are no issues with placing my action in this location, everything is good!

Thanks again,
Anthony
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Component property condition

Hello Anthony,

I am really glad everything works as expected now.

And indeed, you are right about that.

You can have a look over our "Windows Installer Standard Actions" article for more information about this (i.e. what each standard action does).

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

Return to “Building Installers”