Synchronized Folder -> One static component? - Advanced Installer Community

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!

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Synchronized Folder -> One static component?

Hello everyone.

I have the problem that I need to have all files and folders in a synchronized folder to be part of one component to be able to set it/them to "Never Overwrite" and "Permanent" once and be done with it.

As it is now, with new files and folders being added at random to the synchronized folder, these new files and folders at automatically made into new components or not, which then do not have the "Permanent" and "Never Overwrite" attributes set.

This means that we have to manually go into the Organization page of AI to check and set the attributes of all components before we can build an installer.

Is there a way to solve this to avoid manual adjustment for every build?

Ciao

clemens
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Synchronized Folder -> One static component?

Hello everyone.

I just found that it is even worse: One of the synchronized folders keeps being "reset", including its attributes. That means that upon uninstallation that folder is being removed, although I checked "Never Overwrite" and "Permanent" before building the installer.

Ciao

clemens
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Synchronized Folder -> One static component?

Hi Clemens,

Please note that the synchronized folders will always generate new components. This is because you can add new files to the folder on the disk or modify files in it. When the synchronized folder is refreshed, Advanced Installer will see the changed files and it will create new components for it.

Note that it is not recommended to add all the files under the same component. This is because the components are created using rules defined by Microsoft. In your case, you can follow these steps right before a build:
- go to the Files and Folders page and refresh the synchronization
- go to the Organization page and select the feature which contains the components of the files in the synchronized folder
- press SHIFT+F4 on your keyboard to show everything in the feature
- select all the components, right-click one of them and select the "Properties" context menu
- set the attributes you want for the selected components

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Synchronized Folder -> One static component?

Hello Cosmin,

that is a workaround that simplifies going through the list of components, thanks for that.

We are targetting a fully automated build of the installer in a build system, for that manual steps will be serious show stoppers.

What do you think would be possible workarounds?

How about providing configurable component attribute defaults on the feature? And each new component could get its attributes copied from the feature, instead of starting out with everything unchecked, as it is done now?


With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Synchronized Folder -> One static component?

Hi,
What do you think would be possible workarounds?
I'm afraid that the only workaround is to remove the synchronization. Unfortunately, the synchronization feature does not support using the same components every time.
How about providing configurable component attribute defaults on the feature? And each new component could get its attributes copied from the feature, instead of starting out with everything unchecked, as it is done now?
We will consider including this feature in a future version of Advanced Installer. Thank you for your suggestion.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Synchronized Folder -> One static component?

Hello Cosmin,

sorry, I used the wrong term, I meant what would be possible ways to fix this in your opinion. I would file a feature request based on what you or we determine the best approach then.

With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Synchronized Folder -> One static component?

Hi Clemens,

Please note that there is no fix for this. The synchronization feature is basically in contradiction with the idea of having the same components all the time. Therefore, in order to keep the same components the only solution is to remove the synchronization.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Synchronized Folder -> One static component?

Hello Cosmin,

what about the "default attributes" I suggested above though? Would that not fix the problem for me and everyone with similar requirements?



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Synchronized Folder -> One static component?

Hi Clemens,

Yes, I have added this feature on our TODO list and it will be available in a future version of Advanced Installer.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Fully automated build of Installer

Hello Cosmin,

I would like to express my strong interest in full automation of the complete build of the installer, last but not least to remove the human error factor from the process.



To recap the problem that I have:

We have a bunch of files and folders that should be put into the installer. Some of the folders should not be removed in case of an upgrade because they contain user data, database files, etc.

Because our developers can add new files and folders to any of the sub folders (in SVN) which eventually make up our installer, manually updating the AI project is not possible, because it prevents fully automating the build process of the installer.

To avoid manually updating the AI project I added each folder as a synchronized folder, so that it will include new files, remove files that got removed, etc. automatically.

One of the folders being added and configured as a synchronized folder contains user data that must not be removed when upgrading our product. To prevent this, I can set the attributes of the components that the contents of this folder are automatically made into to "Permanent" and "Never Overwrite".

The problem with this is that these component attributes of synchronized folders are partially being reset when building the installer, or rather when the respective synchronization refresh is being performed.



I am astonished that this seems like a case not covered by Windows Installer, nor AI. I expected it to be very common that an application installs default user data files which should be kept across an upgrade (given the "uninstall/install" path of upgrading), and thus to have out of the box support for this to streamline the configuration of such an installer.



I am considering how practical the following is:

Outside of AI:

1) Place all files and folders in the desired folder structure into folder "InstallerFiles" via a script

2) In the "InstallerFiles" rename the folders that should be kept across an upgrade to originalname + ".keep"

Then, in AI:

3) Add the "InstallerFiles" folder to "Files and Folders" as a synchronized folder (it should not be necessary to do this more than once)

And then, in the installer built by AI:

4) In a custom action after copying the files/folders to "Application Folder" either...
a) ...rename all ".keep" folders to their original name - if this is not an upgrade
b) ...delete all ".keep" folders if this is an upgrade



Does this look like it could work? Does this seem too unreliable, or even faulty?



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Synchronized Folder -> One static component?

Hi Clemens,

The Advanced Installer user guide contains the Preserve File on Install how-to which explains how to backup and restore a file during an installation. Perhaps you will consider this approach since you will be able to backup the original files before upgrading and restore them after the upgrade is complete.

The backup custom action can be scheduled under "InstallExecuteSequence" -> "CostFinalize" and the restore custom action under "InstallExecuteSequence" -> "InstallFinalize". Also, these custom actions should use the condition OLDPRODUCTS in order to run only if older versions of the package are present on the target machine.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Synchronized Folder -> One static component?

Hello Cosmin,

thank you for the link, I wll read it (though I suspect that it may not be practical because the size files can easily grow to several gigabytes, which, if nothing else, slows down the installation process, runs risk of out of disk space and takes effort to recover from).

With best regards

Clemens Anhuth
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Synchronized Folder -> One static component?

Hello Cosmin,

in case of a synchronized folder it might also be useful to be able to optionally have all files signed that match a given filename mask, because otherwise all files "included" by a synchronized folder won't be signed by default.

To achieve our goal of full automation I will resort to signing the files separately, in our script that prepares the folder which is represented as a synchronized folder in the AI project.



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Synchronized Folder -> One static component?

Hi Clemens,

I have added this improvement on our TODO list and it will be available in a future version of Advanced Installer. Thank you for your suggestion.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”