codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Synchronized Folders and Upgrades

Tue May 23, 2017 9:10 pm

Hello,

Advanced Installer (AI) has the ability to dynamically add files into an installation using the "Synchronize content with folder from disk" option (http://www.advancedinstaller.com/user-g ... onize.html). My understanding is, this option is not compatible with patches and minor upgrades, since component guids can change, which breaks the rules (http://www.advancedinstaller.com/user-g ... tches.html).


The issue is, in some scenarios, the synchronize option is practically mandatory, because you might be dealing with folders containing hundreds of files (non Portable Executables (PE)) and subfolders. And, these files/folders might be updated (adding/removing files) on a regular basis. It is impractical to add hundreds of non-PE files to AI for two reasons:
  1. They will all get lumped into a single component anyways, since they are non-PE files. And, as far as I know, there is no way to define which file types are treated as PE's.
  2. If files are being added/removed from a folder on a regular basis, it's a pain to have to add/remove them from the installer every time.
So, we arrive at the following dilemma:
Do we use synchronized folders, or do we support patches and minor upgrades? My understanding is, you can't have both.


So, my suggestion is to implement two features (mainly the first):
  1. An option to make the "Synchronize" feature create a separate component for each file (regardless of if it's a PE or not). Logic must be implemented to make sure the component guid stays the same. From what I've read, Heat (http://wixtoolset.org/documentation/man ... /heat.html) can do this with the "-ag" flag set. It sounds like the component guid is based off the file path. So, as long as the file path is the same, the guid will be the same. It also sounds like InstallShield has implemented something similar to this - the "Best Practice Method" for dynamically linked files (http://helpnet.flexerasoftware.com/isxh ... ctices.htm). Though, it's not clear to me if the component guids stay the same.
  2. Add an option to define file extensions to be treated as PE's. That way, they will be added as separate components when I add them to AI. Currently, if I add a bunch of *.txt files, they will all be added into a single component. Then, I have to click each one and click "Move to new component". Not practical for hundreds of files. I believe newer versions of InstallShield allow you to define file extensions to be treated as PE's.

All that being said, I don't understand why non-PE files aren't added to separate components by default. I always see warnings/recommendations about making every file a separate component to avoid issues with repairs/patches/upgrades. So, why isn't this the default behaviour (separate component for every file)? InstallShield behaves the same way. Maybe I'm missing something here, as I don't understand the design decision.


So, to sum up:
Problem - You can't use synchronized folders and support patches/minor upgrades. You can only do one.
Proposed solution - An option for synchronized folders to make every file a separate component and the components have static guids.

Also, if there is a work-around, please let me know. At this point, I'm thinking I might have to write a script to edit the AI project file, adding in my files (from the synchronized folders) as separate components (not fun :( ).


Thanks.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Synchronized Folders and Upgrades

Thu May 25, 2017 2:44 pm

Hello,

Thank you for your feedback. We already have on our todo list such an improvement for sync folders compatibility with patch creation rules and hopefully it will be available soon. As soon as this improvement will be out we will update your forum thread.
All that being said, I don't understand why non-PE files aren't added to separate components by default. I always see warnings/recommendations about making every file a separate component to avoid issues with repairs/patches/upgrades. So, why isn't this the default behaviour (separate component for every file)? InstallShield behaves the same way. Maybe I'm missing something here, as I don't understand the design decision.
This is our current implementation as per a Windows Installer guideline. Maybe we will consider an option to define file extension to be treated as PE (i.e. gain a separate component). Thank you for your suggestion.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: Synchronized Folders and Upgrades

Thu May 25, 2017 3:46 pm

Thank you for your feedback. We already have on our todo list such an improvement for sync folders compatibility with patch creation rules and hopefully it will be available soon. As soon as this improvement will be out we will update your forum thread.
Awesome. I look forward to this addition.
All that being said, I don't understand why non-PE files aren't added to separate components by default. I always see warnings/recommendations about making every file a separate component to avoid issues with repairs/patches/upgrades. So, why isn't this the default behaviour (separate component for every file)? InstallShield behaves the same way. Maybe I'm missing something here, as I don't understand the design decision.

This is our current implementation as per a Windows Installer guideline. Maybe we will consider an option to define file extension to be treated as PE (i.e. gain a separate component). Thank you for your suggestion.
Ya, it appears the AI logic follows this documentation (https://msdn.microsoft.com/en-us/librar ... 85%29.aspx), which makes sense. I guess the issue only pops up when you use the "synchronize" feature, because the folder component ("Define a new component for every folder") is not guaranteed to have the same guid each time (I'm not 100% sure here, but I know guids are changing under certain circumstances). So, I think adding the "static guid" ability to the synchronize feature should fix the issue.
I guess I kind of have a problem with Microsoft's documentation. Why not just say "every file should be it's own component"? This eliminates a lot of unnecessary complexity, and it ensures repair operations fix all files. So, as far as defining file extension for PEs, I guess I'm actually asking for feature that allows me to go against Microsoft's guidelines :) .

ragul
Posts: 5
Joined: Tue Jun 06, 2017 11:55 am

Re: Synchronized Folders and Upgrades

Tue Jun 06, 2017 12:05 pm

Hi Team,
i am developing a installer for my product which has enomours files in it.and as you said i used synchronize from a path to pull the files from the folder without using UI.
But i faced a issue like when it is adding >config or XML file it is pushing as normal file instead as properties files.hoe to restrict or set a rule to see if it is a .config file it need to move as properties file in Advanced installer..
kindly give me a solution for this :?:

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Synchronized Folders and Upgrades

Thu Jun 08, 2017 10:27 am

Hello and welcome to our forums,

Unfortunately we do no have support for this. I've forwarded your request towards our development team and hopefully they will consider this improvement in the future. We will update this thread when such an improvement will be available.

In the meantime the only workaround for you will be to configure a filter for the sync folder support to exclude your XML file(s) and then manually add the files in "Files and Folders" page and import them in the Windows Installer format. However please keep in mind that the XML files imported manually won't keep their source synchronized in the project. So, if their content on disk is updated you should manually re-add them.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Synchronized Folders and Upgrades

Fri Jul 28, 2017 12:40 pm

Hello,

Starting with Advanced Installer 14.2 released on July 26, 2017 we have added an improvement for our "Synchronized Folder" feature to preserve components of the missing files from disk. Just make sure the "Keep in project files deleted from disk" option is checked into your project. This option will be useful not to break the patch rules in what regards the components consistency between different flavors of your setup.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

ragul
Posts: 5
Joined: Tue Jun 06, 2017 11:55 am

Re: Synchronized Folders and Upgrades

Fri Jul 28, 2017 1:05 pm

Hi daniel,
I will check and reply you ...

ragul
Posts: 5
Joined: Tue Jun 06, 2017 11:55 am

Re: Synchronized Folders and Upgrades

Fri Jul 28, 2017 1:36 pm

Hi Daniel,
i had upgrated to 14.2 and checked my scenaio it fails..
my exact scenario was,
1)i have a set of files in folder(like aspx,aspx.cs and .config,.xml)
2)i choosen the synchronize option
3)after folder is sync with advanced installer project .if i seen the .config or .xml is pasted as original file instead like a XML properties file..

can you give me a way to solve this problem...ASAP... :ugeek:

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Synchronized Folders and Upgrades

Tue Aug 01, 2017 9:52 am

Hello Ragul,

I'm afraid the improvement I wrote about was for the scenario exposed at the beginning of the thread by codesynergy.

We currently still don't have support for your request. Also, I cannot give you an ETA for it. Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”