Jump to content
Ketarin forum

Stalker

Members
  • Posts

    195
  • Joined

  • Last visited

Posts posted by Stalker

  1. Now try the method I suggested.

    Basically as far as I can see it everything goes like this:

    1) Ketarin downloads a file

    2) PreviousKnownLocation is updated with a path to downloaded file

    3) User renames the file from outside Ketarin

    4) User updates PreviousKnownLocation entry in the db

    5) User initiates the update

    6) Ketarin checks the PreviousKnownLocation and sees that the file is indeed there and up to date

    7) Ketarin reports the file as up-to-date

  2. That exactly why I have suggested a batch script which updates DB entries.

    will the renamed file in {target} folder be updated ?

    No, the idea is that after renaming the file with some 3rd party tool you modify the "last know location" entry in the database to point to the new file.

    Of course there's also a possibility to make it like uTorrent. When the file is not found it shows that it's missing and you have to locate it manually which will trigger a has check. The obvious con of this method that it's neither a small change nor automatic.

  3. Do you have a better suggestion ? Do you mind sharing ? =)

    A batch script which after renaming will update app's last known location in the database ?

     

    Why should we use Ketarin ONLY as an application distro updater ? For me Ketarin is a general purpose updater, not a strict application distro updater. ;)

    Well, if an application was designed for the task of updating apps and not as a general purpose updater you can't really expect it to have all the features of Swiss Army Knife Updater. While useful for a few this additional functionality (and I'm talking in general here, not about MD5/SHA1) would mean more confusion/bloat for the others.

  4. You do realize that MD5/SHA1 checksums are in no way unique ? They cannot be used to track renaming because there's a possibility that two absolutely different files will have the same checksums.

    While I do agree that Ketarin's renaming may be limited for some uses it work perfectly for what it was built for - maintaining an application distro.

  5. Yes, for {url:ext}. Basically {url} must point to the actual file URL, not what is scraped. So if you scrape something which redirects someplace else into{url} you'll get some useless link in the variable and {url:ext} with {url:basefile} won't work. Actually I don't think implementing {extension} is even needed. Just don't allow people to override some variables.

    Basically the rule of the thumb with variables should be not to override built-in variables unless necessary (like {version}) and try to give them as descriptive names as possible. Copy-paste will save you all the hassle of typing them down and you'll thank yourself later on for not being lazy and naming your variable {application_id} instead of {appid} for example. I really don't see what's so magic in {url} that people prefer using it instead of {link} for example.

  6. Another thing I would suggest against is using global variables unless absolutely necessary. In such case name your global variable to something descriptive and which will associate the variable with your template to avoid naming conflicts. For example {majorgeeks_prefered_mirror} but not {myvar1}.

  7. Regarding templates. Would it be possible to force the user to update some variables on template creation too ? For example for Firefox Addons you need addon ID.

    Another idea would be to allow uploading the templates to online repository (after thorough review though) and show the user these as options when adding new entries.

  8. Please note that this template does not work with addons which require you to either log in or accept a license.

     

    <?xml version="1.0" encoding="utf-16"?>
    <Jobs>
     <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <DownloadBeta>Default</DownloadBeta>
       <DownloadDate xsi:nil="true" />
       <CanBeShared>true</CanBeShared>
       <ShareApplication>false</ShareApplication>
       <HttpReferer />
       <Variables>
         <item>
           <key>
             <string>addon_id</string>
           </key>
           <value>
             <UrlVariable>
               <VariableType>Textual</VariableType>
               <Regex />
               <Url></Url>
               <TextualContent>1865</TextualContent>
               <Name>addon_id</Name>
             </UrlVariable>
           </value>
         </item>
         <item>
           <key>
             <string>version</string>
           </key>
           <value>
             <UrlVariable>
               <VariableType>StartEnd</VariableType>
               <Regex />
               <Url>https://addons.mozilla.org/en-US/firefox/addon/{addon_id}</Url>
               <StartText>title="Permanent link to this version">Version </StartText>
               <EndText></a></EndText>
               <Name>version</Name>
             </UrlVariable>
           </value>
         </item>
         <item>
           <key>
             <string>filename</string>
           </key>
           <value>
             <UrlVariable>
               <VariableType>RegularExpression</VariableType>
               <Regex>(?<=/en-US/firefox/downloads/file/\p{N}*/).*\.xpi(?=")</Regex>
               <Url>https://addons.mozilla.org/en-US/firefox/addon/{addon_id}</Url>
               <Name>filename</Name>
             </UrlVariable>
           </value>
         </item>
       </Variables>
       <ExecuteCommand />
       <Category>Firefox Addons</Category>
       <SourceType>FixedUrl</SourceType>
       <DeletePreviousFile>true</DeletePreviousFile>
       <Enabled>true</Enabled>
       <FileHippoId />
       <LastUpdated xsi:nil="true" />
       <TargetPath>{DEST_DIR}\{category}\{appname}_{version}.{url:ext}</TargetPath>
       <FixedDownloadUrl>http://releases.mozilla.org/pub/mozilla.org/addons/{addon_id}/{filename}</FixedDownloadUrl>
       <Name>AdBlock Plus</Name>
     </ApplicationJob>
    </Jobs>
    

     

    Variables you need to modify:

    addon_id

    Type: local

    Content: ID of addon on Firefox Addons site.

    Example: hxxps://addons.mozilla.org/en-US/firefox/addon/7661

     

    DEST_DIR

    Type: global

    Content: Destination directory of the download

    Example: D:\Distrib

    Additional info: You can modify the save path as you see fit.

  9. 1) When I first requested this feature a while ago Flo came up with global variables idea which I actually like better. I can't continue to love the fact that you just define some global var like {DEST_DIR} and then save all your apps to {DEST_DIR}\{appname}_v{version}.{url:ext} (which can be easily copypasted from entry to entry) and voila ! Instead of something like Vista_R123.zip (Realtek Audio HD Driver package name) you get Realtek HD Audio Driver_v123.zip. Easy to use, easy to read, easy to find.

    2) Since using Ketarin implies having constant internet access I think it could be implemented via dynamically retrieving tooltip content from kb page. That way help is always up to date.

  10. I would actually suggest against redefining any of built-in variables except {version}. This could, and probably would, show problematic when trying to use something like {url:ext}. There is absolutely no reason why you shouldn't just enter the contents of {url} variable directly to the link field.

  11. I think it would be a nice idea to have a forth option when creating a new app entry and that is "Import from template". That way there's a possibility to add more download sites then just FileHippo.

    Template would be an XML similar to app entry XML but without application name. For example consider this for a template to Firefox Addons site (please note that it may not actually be functioning right now if you create your app entry based on this template but this is my best guess from 15 minutes of looking at how the site is structured :) Don't judge harshly. And because I could really remember HTMLs equivalents for < and > I assumed &qt; was < and < was >):

    <?xml version="1.0" encoding="utf-16"?>
    <Jobs>
     <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="b5f78f98-af27-41ba-ac00-377321fdba96">
       <DownloadBeta>Default</DownloadBeta>
       <DownloadDate xsi:nil="true" />
       <CanBeShared>true</CanBeShared>
       <ShareApplication>false</ShareApplication>
       <HttpReferer />
       <Variables>
         <item>
    
           <key>
             <string>addon_id</string>
           </key>
           <value>
             <UrlVariable>
               <VariableType>StartEnd</VariableType>
               <Regex />
               <Url>https://addons.mozilla.org/en-US/firefox/search?q={appname:replace: :+}&cat=all</Url>
               <StartText>&qt;h3 class="name"<&qt;a href="/en-US/firefox/addon/</StartText>
               <EndText>" <</EndText>
               <Name>addon_id</Name>
             </UrlVariable>
           </value>
    
           <key>
             <string>version</string>
           </key>
           <value>
             <UrlVariable>
               <VariableType>StartEnd</VariableType>
               <Regex />
               <Url>https://addons.mozilla.org/en-US/firefox/addon/{addon_id}</Url>
               <StartText>title="Permanent link to this version"<</StartText>
               <EndText>&qt;/a<</EndText>
               <Name>version</Name>
             </UrlVariable>
           </value>
    
           <key>
             <string>link</string>
           </key>
           <value>
             <UrlVariable>
               <VariableType>StartEnd</VariableType>
               <Regex />
               <Url>https://addons.mozilla.org/en-US/firefox/addon/{addon_id}</Url>
               <StartText>&qt;p class="install-button platform-ALL"<
               &qt;a href="</StartText>
               <EndText>"</EndText>
               <Name>link</Name>
             </UrlVariable>
           </value>
    
           <key>
             <string>sha1</string>
           </key>
           <value>
             <UrlVariable>
               <VariableType>StartEnd</VariableType>
               <Regex />
               <Url>https://addons.mozilla.org/en-US/firefox/addon/{addon_id}</Url>
               <StartText>addonHash="</StartText>
               <EndText>"</EndText>
               <Name>sha1</Name>
             </UrlVariable>
           </value>
    
         </item>
       </Variables>
       <ExecuteCommand />
       <Category>Firefox Addon</Category>
       <SourceType>FixedUrl</SourceType>
       <PreviousLocation></PreviousLocation>
       <DeletePreviousFile>true</DeletePreviousFile>
       <Enabled>true</Enabled>
       <FileHippoId />
       <LastUpdated></LastUpdated>
       <TargetPath>{DEST_DIR}\{category}\{appname}_{version}.{url:ext}</TargetPath>
       <FixedDownloadUrl>https://addons.mozilla.com/{link}</FixedDownloadUrl>
       <Name>INSERT YOUR APPLICATION NAME HERE</Name>
     </ApplicationJob>
    </Jobs>
    

     

    Basically you insert the name of your addon and it will find the closest match on Firefox Addons site. It is a bit trickier then FileHippo due to the fact that you need to know addon ID (which is a number and has no visible relation to addon name) to download the addon and thus such computations. Automatic retrieval of ID can be done in the same way Ketarin now handles FileHippo (paste a link and parse the ID from there) but I don't know how to do it in a generic way (maybe with some heavy use of regex) so currently the example contains flaky variable way.

    Same templates can be added for other sites, like even FileHippo instead of having its own entry in the Add app dialog, to make Ketarin more robust.

×
×
  • 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.