Ragnarocek
Posts: 5
Joined: Thu Feb 13, 2014 5:03 pm

Backup files before installation of feature

Hello all,

need some little help. I was built installer, which can install about 15 features. But I need to backup one directory in [APPDIR] if one of features is selected. It is a modpack for a World of Tanks game.

need to backup folder: [APPDIR]\res\audio and if user choose uninstallation, that folder will be restored...

Is this possible ? If yes, can you write some detailed gude how to do that ? Im very new in making any install and my scripting skills are very very limited.

Thanks a lot.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Backup files before installation of feature

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve this you can use our file copy/move support. For example, you can use a files move operation on install which will move the "audio" folder content in a backup location and another files move operation which will restore the "audio" folder on uninstall. Also, you can create a registry value which will be installed when the backup operation is required and add the files move operations under the registry component. Here are the steps to proceed:
- go to "Registry" page and add a registry value (e.g. "BackupReg")
- select the registry value and from its context menu use the "Go To Component" option
- in "Organization" page move its selected component under the feature which requires the backup operation
- go to "Files and Folder" page and create a backup folder (e.g. [APPDIR]\res\audioBackup)
- in the "audioBackup" folder add a files move operation like this:
  • Source File Name: *.*
    Source File Folder: APPDIR\res\audio

    Destination File Name:
    Destination File Folder: APPDIR\res\audioBackup

    Component: BackupReg's component
    Execute On: Component install
    Operation: Move
- in the "audio" folder add a files move operation like this:
  • Source File Name: *.*
    Source File Folder: APPDIR\res\audioBackup

    Destination File Name:
    Destination File Folder: APPDIR\res\audio

    Component: BackupReg's component
    Execute On: Component uninstall
    Operation: Move
- build and run your project

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ragnarocek
Posts: 5
Joined: Thu Feb 13, 2014 5:03 pm

Re: Backup files before installation of feature

Thanks for help... It works...
Ragnarocek
Posts: 5
Joined: Thu Feb 13, 2014 5:03 pm

Re: Backup files before installation of feature

Can I ask you one more question ? I'm using installation with Quick selection tree. I can't find function for sub selection.

This is how it looks:
Image

Need to achieve that if I select Config1, Config2 remain unselected and if i mark Config2, Config1 will be automatic unmarked. It is possible ? This is really last thing that I need to know :) Im also asking for guide as in first post (btw it is very simple and very helpful).

many thanks

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

Re: Backup files before installation of feature

Hello Ivo,

I'm afraid we don't have predefined support for this scenario. However, in order to achieve this you can create your own custom feature selection dialog. Then, you can add published events on your feature associated check boxes. For example, you can add on your first check box (CHEKCBOX_CONFIG1) two published events like this:
  • Control Event: Set installer property value
    Property: [CHEKCBOX_CONFIG2]
    Argument: {}
    Condition: CHEKCBOX_CONFIG1

    Control Event: Set installer property value
    Property: [CHEKCBOX_CONFIG2]
    Argument: checked
    Condition: NOT CHEKCBOX_CONFIG1
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ragnarocek
Posts: 5
Joined: Thu Feb 13, 2014 5:03 pm

Re: Backup files before installation of feature

Daniel wrote:Hello Ivo,

I'm afraid we don't have predefined support for this scenario. However, in order to achieve this you can create your own custom feature selection dialog. Then, you can add published events on your feature associated check boxes. For example, you can add on your first check box (CHEKCBOX_CONFIG1) two published events like this:
  • Control Event: Set installer property value
    Property: [CHEKCBOX_CONFIG2]
    Argument: {}
    Condition: CHEKCBOX_CONFIG1

    Control Event: Set installer property value
    Property: [CHEKCBOX_CONFIG2]
    Argument: checked
    Condition: NOT CHEKCBOX_CONFIG1
Let us know if this helped.

All the best,
Daniel
BINGO... You guided me well mate :) Thank you very much :D
Ragnarocek
Posts: 5
Joined: Thu Feb 13, 2014 5:03 pm

Re: Backup files before installation of feature

I am lame i think :)

If I use checkoxes instead of quick selection tree, how can I display Feature description in text field as is shown un image posted before ? Text must change if I click other checkbox... And can I set checkbox as child of other checkbox (like config1 and config2 on image)
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Backup files before installation of feature

Hello,
If I use checkoxes instead of quick selection tree, how can I display Feature description in text field as is shown un image posted before ? Text must change if I click other checkbox...
In order to achieve this you can add a static text control (e.g. Description_Config1) which will contain the description for Config1. Add the following control conditions on your "Description_Config1" control:
  • Condition: CHEKCBOX_CONFIG1
    Action: Show

    Condition: NOT CHEKCBOX_CONFIG1
    Action: Hide
Then, on top of the above static text control you can add another static text control (e.g. Description_Config2) having the following control conditions.
  • Condition: CHEKCBOX_CONFIG2
    Action: Show

    Condition: NOT CHEKCBOX_CONFIG2
    Action: Hide
And can I set checkbox as child of other checkbox (like config1 and config2 on image)
Yes, you should be able to achieve this. You can add proper "Set installer property value" published events on your check boxes in order to select/deselect them.

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

Return to “Common Problems”