Quote from saeid on April 10, 2021, 9:37 amI extract my Embedded files in [PubDir] by the following example code in order to use them in my publication :
ExtractFile "[Embedded]Pic1.jpg" "[PubDir]"
I want that these extracted files to be removed from [PubDir] after shutting down the publication. So, I check "Remove extracted files when publication terminates" option during compiling process. But the extracted files still exist in [PubDir] after shutting down the publication.
Does anyone have a solution?
I extract my Embedded files in [PubDir] by the following example code in order to use them in my publication :
ExtractFile "[Embedded]Pic1.jpg" "[PubDir]"
I want that these extracted files to be removed from [PubDir] after shutting down the publication. So, I check "Remove extracted files when publication terminates" option during compiling process. But the extracted files still exist in [PubDir] after shutting down the publication.
Does anyone have a solution?

Quote from Vadim on April 10, 2021, 10:01 am@saeid
You can add the command to delete the desired files (FileErase) to the Shutdown tab in the project properties (Commands section).
The commands written on this tab will be executed just before you close your application.
You can add the command to delete the desired files (FileErase) to the Shutdown tab in the project properties (Commands section).
The commands written on this tab will be executed just before you close your application.
Quote from saeid on April 10, 2021, 10:46 am@vadim
Thanks for your reply.
Your suggestion is the way that I'm using now. I'm searching for a way that publication automatically remove the extracted files. Because there are large number of extracted files and it needs hundreds lines of code to delete them.
I don't know if there is such a way?
Thanks for your reply.
Your suggestion is the way that I'm using now. I'm searching for a way that publication automatically remove the extracted files. Because there are large number of extracted files and it needs hundreds lines of code to delete them.
I don't know if there is such a way?
Quote from Jlash on April 10, 2021, 11:37 amSe me ocurre extraerlos en:
ExtractFile "[Embedded] Pic1.jpg" "[PubDir]/carpeta"
y al salir eliminar la carpeta entera.
Se me ocurre extraerlos en:
ExtractFile "[Embedded] Pic1.jpg" "[PubDir]/carpeta"
y al salir eliminar la carpeta entera.

Quote from HPW on April 10, 2021, 11:44 amHello,
The option for automatic removel is for automatic extracted files (As far I know).
With command "Extractfile" you are responsible for the removing.
But why hundred lines of code?
Keep an array with all files including path and a counter-variable.
In shut down loop through the array and delete what you want.
This will be a few lines.
By the way: Extracting to PubDir is not a good idea. You can get problems with access-rights.
Regards
Hello,
The option for automatic removel is for automatic extracted files (As far I know).
With command "Extractfile" you are responsible for the removing.
But why hundred lines of code?
Keep an array with all files including path and a counter-variable.
In shut down loop through the array and delete what you want.
This will be a few lines.
By the way: Extracting to PubDir is not a good idea. You can get problems with access-rights.
Regards
Quote from saeid on April 10, 2021, 2:32 pm@hpw
Hi,
Thanks for your response.
Would you please send me an example code of your suggested solution?
And what's your preferred location to extract my Embedded files instead of [PubDir]?
Hi,
Thanks for your response.
Would you please send me an example code of your suggested solution?
And what's your preferred location to extract my Embedded files instead of [PubDir]?

Quote from HPW on April 10, 2021, 7:46 pmHello,
Untested code idea:
ExtractFile "[Embedded]Pic1.jpg" "[TempDir]" Setvar "[ExtractList1]" "Pic1.jpg" Setvar "[ExtractCount]" "1" ExtractFile "[Embedded]Pic2.jpg" "[TempDir]" Setvar "[ExtractList2]" "Pic2.jpg" Setvar "[ExtractCount]" "2" .This code in Shutdown action Loop "1" "ExtractCount" "[ExtractCounter]" FileErase "[TempDir][ExtractList[ExtractCounter]]" EndLoop
Hello,
Untested code idea:
ExtractFile "[Embedded]Pic1.jpg" "[TempDir]" Setvar "[ExtractList1]" "Pic1.jpg" Setvar "[ExtractCount]" "1" ExtractFile "[Embedded]Pic2.jpg" "[TempDir]" Setvar "[ExtractList2]" "Pic2.jpg" Setvar "[ExtractCount]" "2" .This code in Shutdown action Loop "1" "ExtractCount" "[ExtractCounter]" FileErase "[TempDir][ExtractList[ExtractCounter]]" EndLoop