VincentL
Posts: 2
Joined: Mon Oct 30, 2017 8:52 pm

Call a custom action when file download is finished

Hello everyone,

I followed the instructions described in this tutorial: https://www.youtube.com/watch?v=Bc4n7IO_YTU

Generally it works, but if the archive contains special characters like ä-ű-ő-é-á etc. the file names are messed up after the extraction (seems like an encoding problem).

So I decided to create my own extractor in C#. I'm familiar with the DLL creation/custom action process, but I don't know how to catch the moment when the file download is finished in the installer (so I can call my custom action to extract the downloaded archive).

I would also like to update the status bar, but I already found an example for that here: http://www.advancedinstaller.com/forums ... =5&t=27535

Thanks,
Vincent
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Call a custom action when file download is finished

Hello Vincent and welcome to our forums,
Generally it works, but if the archive contains special characters like ä-ű-ő-é-á etc. the file names are messed up after the extraction (seems like an encoding problem)
I've tested this scenario but couldn't reproduce this issue. Could you give us a clear testcase and the version of Advanced Installer you use, so we could further investigate this issue?
but I don't know how to catch the moment when the file download is finished in the installer (so I can call my custom action to extract the downloaded archive)
Our File Download operation is triggered by "AI_FdInstall" action from "InstallExecutionSequence". You could place your custom action after Add Resources group. Please note that in order to be able to access the file, this custom action should run "When the system is being modified (deferred)".

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
VincentL
Posts: 2
Joined: Mon Oct 30, 2017 8:52 pm

Re: Call a custom action when file download is finished

Thank you Sorin for the quick answer, I'll try it out soon.
I've tested this scenario but couldn't reproduce this issue. Could you give us a clear testcase and the version of Advanced Installer you use, so we could further investigate this issue?
Yes of course, I created an AI project which extracts a sample zip with random files (no download this time). I'm currently evaluating the 14.4 version of Advanced Installer (Enterprise). I attached the project file and the zip.

Here is what happens on my end: the left side shows how the files are extracted by the installer, the right shows the original zip contents.
Image

If you are using the .NET Framework's ZipArchive Class for the extraction internally, I can help with a solution (I ran into a similar problem using that class).

Best regards,
Vincent
Attachments
extract.zip
the sample zip, originally on my i:\Installer\ directory
(122.88 KiB) Downloaded 491 times
Accented_ZIP_Test.aip
AI project
(14.84 KiB) Downloaded 600 times
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Call a custom action when file download is finished

Hello,

Thank you for providing a sample. I can reproduce and confirm this issue. A fix will be available in a future version of Advanced Installer.

Unfortunately the only workaround I could think of would be to write your own custom action that extracts the archive.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Call a custom action when file download is finished

Hello,

This was fixed in version 16.2 of Advanced Installer released on August 1st, 2019.

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

Return to “Building Installers”