Pandoranga
Posts: 9
Joined: Fri Jul 23, 2021 9:33 am

Reinstall BackupFolder

Tue Jul 27, 2021 6:09 pm

Hello Community.
I am new to you. Have already read a lot but not found the one where I could have solved my problem.

I'll try to describe.
I use the Advanced Installer 17.2. I create modifications for the game "Anno 1404"

These I make available for interested players.
For this purpose I have created a "backup folder" in the installer where the original files are moved to.

If the user does not want to play the modification anymore, i want to give him the possibility to uninstall the modification with simultaneous return of the original files.
How can I configure this in the installer.

I thank you in advance for your efforts.
Greetings Pandoranga
Attachments
Installation files.jpg
Installation files.jpg (82.13KiB)Viewed 34433 times
ProduktDetails.jpg
ProduktDetails.jpg (173.36KiB)Viewed 34433 times
Files and Folders.jpg
Files and Folders.jpg (160.81KiB)Viewed 34433 times

Pandoranga
Posts: 9
Joined: Fri Jul 23, 2021 9:33 am

Re: Reinstall BackupFolder

Wed Jul 28, 2021 8:20 am

Some more Screens...
Attachments
Edit File Copy-Move.png
Edit File Copy-Move.png (125.1KiB)Viewed 34424 times
GameFolder.jpg
GameFolder.jpg (143.01KiB)Viewed 34424 times
Backup Folder.jpg
Backup Folder.jpg (67.79KiB)Viewed 34424 times

Pandoranga
Posts: 9
Joined: Fri Jul 23, 2021 9:33 am

Re: Reinstall BackupFolder

Wed Jul 28, 2021 2:34 pm

Somehow my request seems too complicated or not expressed in a technical way. So maybe then formulated a little differently. I would like to restore the saved contents of the Bachup folder via installer (during uninstallation).... Is it possible to configure that???. Thanks

Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Reinstall BackupFolder

Thu Jul 29, 2021 2:02 pm

Hello Pandoranga,

You can do that using a script, for example a .bat file:

Code: Select all

xcopy /Y %1 %2

Now you need to add the script as a temporary file, go to the "Files and Folders" page, and from the toolbar menu click on "Add Temporary Files" button.

After that, you need to trigger that script on uninstall, go to the "Custom Actions" page, add a "Launch file" custom action with sequence, scheduled after "Install Execution Stage --> Remove Resources" action group, and configure it like in the screenshot:
Screenshot_1.png
Screenshot_1.png (80.72KiB)Viewed 34393 times
where "[backup_Dir]" and "[main_Dir]" are the identifier properties of your backup and main folders. Right click on your backup/main folder, and in Properties you can find the "Identifier".
Screenshot_2.png
Screenshot_2.png (11.77KiB)Viewed 34393 times

Hope this works! If you have any other questions, please don't hesitate to contact us.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Pandoranga
Posts: 9
Joined: Fri Jul 23, 2021 9:33 am

Re: Reinstall BackupFolder

Thu Jul 29, 2021 5:43 pm

Hello Liviu,
Thank you very much for your feedback and the explanations.
But unfortunately I can't get it to work.
I have created a "bat" file and placed it on the desktop.
Then I proceeded as you described.

In the second step, I can't get the bat file to work.
As you can see in my screen "GameFolder" there is no "main" folder.

Perhaps for general understanding.
The installer package I provide only contains the folders "addon" and "maindata".
The complete folders and their contents are first copied into the backup folder during the installation.
Then the new contents of "addon" and "maindata" are installed into the original folders of the game.

If the user wants to reset his game, the original files from the backup folder (addon and maindata) should be copied back through the uninstallation...

I also do not understand the script command you have given...

If you have any other ways or help I would be grateful.

Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Reinstall BackupFolder

Fri Jul 30, 2021 9:38 am

Hi Pandoranga,

Can you please send us the .AIP (setup project) file by email to support at advancedinstaller dot com so we can further test and investigate this?

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Pandoranga
Posts: 9
Joined: Fri Jul 23, 2021 9:33 am

Re: Reinstall BackupFolder

Fri Jul 30, 2021 10:06 am

When you say AIP (setup project) do you mean just the saved project or all the associated files (total size 3.6GB)?
Last edited by Pandoranga on Sat Jul 31, 2021 8:29 am, edited 2 times in total.

Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Reinstall BackupFolder

Fri Jul 30, 2021 10:10 am

Just the saved project, the .AIP file.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Pandoranga
Posts: 9
Joined: Fri Jul 23, 2021 9:33 am

Re: Reinstall BackupFolder

Fri Jul 30, 2021 10:16 am

E-mail is out...
Thank you for your efforts...
Last edited by Pandoranga on Sat Jul 31, 2021 8:29 am, edited 1 time in total.

Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Reinstall BackupFolder

Fri Jul 30, 2021 1:37 pm

Hi Pandoranga,

From what I can see in your setup project, on your custom action “LaunchFile” properties, you didn’t configure the command line option as described. You are missing the quotes for the path variables. Your command line should be:

Code: Select all

"[addon_1_Dir]" "[addon_Dir]" "[maindata_1_Dir]" "[maindata_Dir]"
Note that for the .bat script, in the “xcopy” the first parameter is the Source and the second parameter is the Destination.

Now your .bat script will look like this:

Code: Select all

xcopy /Y %1 %2
xcopy /Y %3 %4
Meaning you copy from the first parameter “addon_1_Dir” to the second one “addon_Dir”.

You can read about xcopy commands here: Xcopy Command

I attached you here a sample .aip project that uses powershell script to copy the related files.

Hope this helps! If you have any other questions, please don't hesitate to contact us.

Best regards,
Liviu
Attachments
Restore App.aip
(17.18KiB)Downloaded 615 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Pandoranga
Posts: 9
Joined: Fri Jul 23, 2021 9:33 am

Re: Reinstall BackupFolder

Fri Jul 30, 2021 3:49 pm

Hello Liviu,
you are my hero. !! :D

So with the "bat script file" and "custom action "LaunchFile" it doesn't work. :oops:

Then I looked at the RestoreApp.aip and took the PowerShellScriptInline. :shock:
With this it works wonderfully. :o :o :o

Thank you very much for your perseverance and competent support. 8-)
Greetings
Attachments
PowerShellScriptInline.jpg
PowerShellScriptInline.jpg (525.71KiB)Viewed 34204 times

Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Reinstall BackupFolder

Mon Aug 02, 2021 7:46 am

You are always welcome, Pandoranga!

I am glad to hear this works now.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Pandoranga
Posts: 9
Joined: Fri Jul 23, 2021 9:33 am

Re: Reinstall BackupFolder

Mon Aug 02, 2021 9:50 am

Hello Liviu.
I hope you had a restful weekend.
A small problem has appeared.
When I reinstall the product after uninstalling it, a message appears. If I click on "Ignore" the installer finishes normally and everything is ok. I cannot understand this message. I don't have the necessary programming knowledge. Can you help me again please. Is it still possible to fix the error message?
Attachments
Message sufficient access.jpg
Message sufficient access.jpg (295.87KiB)Viewed 33884 times

Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Reinstall BackupFolder

Tue Aug 03, 2021 3:11 pm

Hi Pandoranga,

I'm not sure why you encounter this problem.

Can you please send us the .AIP (project file) and a verbose log of the reinstallation failure by email to support at advancedinstaller dot com so we can further test and investigate this?


Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Pandoranga
Posts: 9
Joined: Fri Jul 23, 2021 9:33 am

Re: Reinstall BackupFolder

Tue Aug 03, 2021 4:36 pm

Hi Liviu,
I have solved the problem.
I unchecked the "Override Windows Installer programs list entry" in "Product Details". Now the package runs as it should.
Thanks a lot for your support.

Greetings
Pandoranga
Attachments
Product Details.jpg
Product Details.jpg (139.31KiB)Viewed 33546 times

Return to “Building Installers”