Jump to content
Ketarin forum

Updating and delting apps


jokerfool
 Share

Recommended Posts

I've noticed that if I have the option "Always delete previously downloaded file" this doesn't seem to work to well when updating, so in the commands before download I add the del option to remove the file first but that doesn't get removed either.

 

For example 7zip

 

12/02/2018 11:05:53 AM: Update finished
12/02/2018 11:08:22 AM: Update started with 1 application(s)
12/02/2018 11:08:23 AM: 7z x64: Using referer: (none)
12/02/2018 11:08:25 AM: 7z x64: Server source file: /download/file/b721c53126d57c154cf80d79b9731992f8a014c899bac6eda1264e1eeb54d20f
12/02/2018 11:08:25 AM: 7z x64: Determined target file name: d:\GEGeek_Toolkit\ProgramFiles\Apps To Install\7z x64\7z1801.exe
12/02/2018 11:08:25 AM: 7z x64: Checking if update is required...
12/02/2018 11:08:25 AM: 7z x64: Update required, 'd:\GEGeek_Toolkit\ProgramFiles\Apps To Install\7z x64\7z1801.exe' does not yet exist
12/02/2018 11:08:25 AM: 7z x64: Skipped downloading updates
12/02/2018 11:08:25 AM: Update finished

I click update

d:\GEGeek_Toolkit>ren "d:\GEGeek_Toolkit\ProgramFiles\Apps To Install\7z x64\7z1801.exe" 7z_x64.exe
A duplicate file name exists, or the file << Why didn't the app delete the previous file?
cannot be found.

 

So I add del "{file}" 7z_x64.exe to remove this file before downloading and untick the "Always delete previously downloaded file"

 

12/02/2018 11:12:21 AM: 7z x64: Executing command: ren "d:\GEGeek_Toolkit\ProgramFiles\Apps To Install\7z x64\7z1801.exe" 7z_x64.exe
12/02/2018 11:12:21 AM: 7z x64: Command result: Microsoft Windows [Version 10.0.16299.192]
(c) 2017 Microsoft Corporation. All rights reserved.
d:\GEGeek_Toolkit>ren "d:\GEGeek_Toolkit\ProgramFiles\Apps To Install\7z x64\7z1801.exe" 7z_x64.exe
A duplicate file name exists, or the file
cannot be found.

 

Just can't seem to get the app to remove the previous file before downloading.

It downloads the latest version and the old file is still in the same directory.

7z.xml

Link to comment
Share on other sites

It only deletes the previous file if it was created/downloaded with Ketarin.

If you've renamed the file then it won't delete the previous file.

It only deleted the previous file if the path is EXACTLY the same as it was when it was downloaded (for example, the drive name can't change).

If you've changed/replaced the app profile (in other words, it's not the same as the one that actually downloaded the file) then it won't delete the previous file, because the reference to the previous file doesn't exist. 

To find out for sure whether a file will be deleted select the app profile in the main Ketarin window, CTRL+C, then paste it into notepad. Look for the "PreviousLocation" value. If this value is populated, then that is the file that will be deleted. If it's NOT populated, then it won't delete anything.

Link to comment
Share on other sites

for your specific example, you would be better off ignoring the "delete previous file" setting and using a generic download name instead. On the Application tab, in the Download Location field, make sure the option is set to "Save to File" (not "Save in Folder") and use this value:

{root}GEGeek_Toolkit\ProgramFiles\{category}\7z x64\7z_x64.exe

This skips the actual issue with your profile, which is that you're changing the filename after the download to a generic installation package name. Sure, it's being done as part of the post-commands, but it still changes the file name from what was downloaded.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.