Jump to content
Ketarin forum

Ambimind

Members
  • Posts

    67
  • Joined

  • Last visited

Everything posted by Ambimind

  1. Motivation Ketarin has a built-in feature to remove the last downloaded file. But, what if one wanted to keep a history of 2 or 3 or X prior versions; and to delete the oldest file only, as newer version became available, thus maintaining a fixed number of installers? And why not, while we're at it, get a sense of how the new Powershell integration works in Ketarin? These will be our aims. Solution 1. Take any one of your Ketarin applications(jobs), for which you require a history of installers, lets say a maximum of 3. 2. In this case it is important that each new downloaded installer has a unique name. If the publisher does not provide for this, you may use the following solution : {appname}_{f:yyyy}-{f:MM}-{f:dd}.{url:ext} 3. Next we will input the Powershell script. First, as shown below, change the command type to "Powershell script". Note that the script will be executing only AFTER the new file is downloaded. 3.1. Into the input(purple border) shown in Image 2, paste the following Powershell script : #PURPOSE: # Ketarine can delete the previous downloaded file. # However there are circumstances when 2 or more copies are desirable. # This script automates the keeping multiple copies. # $keep determines number of copies. #ASSUMPTIONS: # 1. That script is run after new file download. # 2. That downloaded file is unique. # 3. That there are no other files, but program installers, in download location(See Note 2). #NOTE: # 1. Any files previously downloaded, numbering more then $keep, will be deleted. # 2. Subfolders will not be deleted, store supporting files there. #Number of files to keep $keep = 3 # Location variables $file = $app.CurrentLocation $fdir = (Get-Item $file).DirectoryName $fnm = (Get-Item $file).Basename $fext = (Get-Item $file).Extension $fnmext = (Get-Item $file).Name $kroot = PWD #Change dir to current job dir CD $fdir #An object containing file refs, sorted by creation time(first being newest) $fsorted= Get-ChildItem -File | Sort-Object -Property LastWriteTime -descending #Select the newest files, as specified by $keep $newset = $fsorted | Select-Object -First $keep #Delete the others $fsorted | Remove-Item -Exclude $newset Remarks : It is important to note that before proceeding to run the script, one must place all supporting, non-installer files in a sub-folder. In addition, it is assumed that each job/app has its own folder. Please also refer to the following link, to understand the purpose of the variables at the start of the script : https://ketarin.org/forum/topic/3940-tip-ketarin-variable-equivalents-in-powershell/?p=10697 This is of course a very simple script, however it should now be clear where and in what capacity one can use Powershell in Ketarin. Also now you have a convenient way to maintain more then one installer per job, while limiting the total number.
  2. Ketarin variables and their equivalents: The variables are placed into four groups according to essential character. Ketarin Powershell -------- ------------ [Native] {filesize} $app.LastFileSize {category} $app.Category {appname} $app.Name or $app {appguid} $app.Guid {file} [$file =] $app.CurrentLocation [Derived : refer to {file}] {url:ext} (Get-Item $file).Extension {url:basefile} (Get-Item $file).Basename (result: ccleaner) {root} split-path $file -Qualifier (result: C:) (PWD).drive.root (result: C:\) Job/App dir (Get-Item $file).DirectoryName (no trailing \) File.Ext (Get-Item $file).Name {startuppath} PWD (assumes no prior CD) (no trailing \) [Job specific user defined variables] {"myvar"} $app.variables."myvar".CachedContent $app.variables."myvar".TextualContent [User-defined global variables] {"myglobalvar"} $globalvars."myglobalvar".CachedContent How to make their use more convenient ? The native Ketarin syntax is very convenient. To assist in making the Powershell equivalents more so, you may do the following. At the beginning of each cammand input insert a predefined, saved snippet that looks something like this: $file = $app.CurrentLocation $fdir = (Get-Item $file).DirectoryName $fnm = (Get-Item $file).Basename $fext = (Get-Item $file).Extension $fnmext = (Get-Item $file).Name $kroot = PWD How do you know this without official documentation ? From within a Ketarin command input, set to "Powershell script", and type: $app | Select-Object * | Out-File c:\app.txt -width 400 $globalvars | Select-Object * | Out-File c:\globalvars.txt -width 400 Repeat whenever you encounter a property which refers to a sub-object, ie. {.....}. Also, don't forget "Get-Member" and "Get-Member -Force".
  3. BUG Description : Set "Textual content"-urlVariables with Powershell script >> Variable no longer visible in custom column; no longer reactive to change. Edit : This is a user fault(my fault), not Ketarins. It turns out that after manually modifying a textual content variable, one must start an update process on the app. Even if there is nothing to update, but only after this process is complete, will the change become visible in a custom column. When it is done via a Powershell script, but using "run", outside the normal update cycle, the same course is required. Pardon me.
  4. To "put this data into database," two steps are required, as described. A. Create a custom variable(a "url-Variable") - eg. "version" - set to "Textual content". B. Use Powershell within Ketarin to modify the variable, with the version number you've acquired(eg. stored in $ver): $app.variables.version.TextualContent = $ver Note: You must set command inputs to "PowerShell script". Btw, Ketarin does not require the version number to decide when to download a new file. It can also use file size, automatically diffed. Edit : Initially I had an illustration to show the process. In hind-site I missed a step, so I removed it.
  5. Its the same situation with AVG. I had moved all my downloads away from File Hippo and these were the last two remaining. The solution : For this and other reasons, don't use FH; check the online database for "iTunes (Setup 64-bit)". I had avoided using the job from the online database because initially it looked like a temporary hack. After finding the solution on my own, it turns out it is not. A solution, briefly : 1. At the download page : http://www.apple.com/itunes/download 2. You'll find that the download button lives within an iframe : <iframe src="https://swdlp.apple.com/iframes/82/en_us/82_en_us.html" title="Please select a download." name="myframe" frameborder="0" allowtransparency="true" scrolling="no"> Your browser is not compatible with this content; please upgrade to a standards-based browser. </iframe> 3. Within this page - "82_en_us.html" - you'll find the download link(as of today, using browser dev tools) : https://secure-appldnld.apple.com/itunes12/031-63219-20160602-7ED70DD0-2901-11E6-ADA3-A417672719FC/iTunes6464Setup.exe 4. This can be matched for, at the specific url, with a regex: https://secure-appldnld.apple.com/itunes\d+/[-0-9A-Z]+/iTunes6464Setup.exe or as in said online db job : https[^']*itunes6464setup.exe 5. And along with referrer spoofing, the gotten url is used to download itunes. This leaves Ketarin to determine new versions based on file size. Repeat for the 32bit version. The solution for AVG is much simpler, if you need it?
  6. I've attached a job for the 64bit JDK, which I use. You may import it and try understanding how it was achieved. Very briefly : Get the latest version number, spoof referrer url and agent, pass the checkbox cookie(which is constant), download via url that integrates cookie and current version number. You could also do this with Curl in a more general way. To get it to work you will need to set a valid download directory. And on first run, right-click on the imported job and choose "Force download". Tip : Track the logs to see how the variables are 'filled' at download-time. Once you've grasped the process, you can use it with all the other Oracle downloads you require. Edit : [12_August_2016] : Correction to regex to permit build numbers greater then two digits. Edit : [19_January_2017] : Made compatible with new url structure. Edit : [26_August_2019] : Fixed broken OracleJDK job, also added OpenJDK job - both jobs will download the current release, not the LTS version OracleJDK_64.xml OpenJDK_64.xml
  7. Also important when running from a USB, is to store all the downloaded installers in a folder 'next' to the Ketarine executable. This means choosing an appropriate "Download location" for each "job", as illustrated below:
  8. Motivation PSlang is overloaded, confounding and extremely verbose, however its well integrated .net: regex, http and file processing facilities - make it worthwhile in complex tasks. Such a complex task may involve sending post data with dynamically generated cookies and varying referrer-urls, across several http requests. Example A PS script file (FabsAB.ps1) is placed in the directory intended for a downloadable installer. The script is written so as to download and process files within its containing folder. It is assumed that Ketarin is aware of this folder via its "Download location"(Application tab) setting. Solution included below is the command to call this script, and its placement with other commands, part of the pre-download steps for the job : POWERSHELL -command ".\FabsAB.ps1" Problems If after running the command one finds Ketarin unable to finish it, it will be necessary to find "Powershell.exe" in "Windows Task Manager" and kill the process. This is likely related to PS security restrictions. To resolve this we need to set "PS execution policy" for both the "LocalMachine" and "CurrentUser": Within a PS terminal with admin-rights type one after the other: Set-ExecutionPolicy Unrestricted -Scope CurrentUser then type "Y" Set-ExecutionPolicy Unrestricted -Scope LocalMachine then type "Y" Get-ExecutionPolicy -List to check the current state of affairs Remarks It is also possible to run multiple Powershell commands, not written in a file : POWERSHELL -command "Get-Content a.txt -Raw; $fab='All done'; $fab"
  9. This is how I can see hashes being used in Ketarin. Am I missing some aspect ? : EDIT: Soon after posting I realized the job was failing thus: This was fortunate because it demonstrated the two ways Ketarin is using hashes: - for determining when to download newer installers - for checking the integrity of the installer, as intended by the author(not necessarily the distributor) This is indeed a very useful addition - thank you. In this case, failure was occurring because the hash generated by Ketarin has no spaces(the hash from the website does). We can resolve this:
  10. re: "user echo" : Thx, wasn't aware. re: .net4 : I see, thanks for making it clear.
  11. Thanks much floele! Just upgraded specifically for : "* Improved file download speed for unknown file sizes (buffer was unnecessarily small)" Tested a full update and install sequences - all work fine. Question about checksums: I make use of checksums all the time when doing backups, however I'm uncertain how I would make use of them with Ketarin; would anyone be able to provide an overview workflow/use case scenario?
  12. Thank you kindly for continued development of Ketarin. It is truly a unique a indispensable tool! The impetus for the following feature requests come from my attempts to install ketarin as proxy silent update mechanism - that is, without constantly running, myriad update services, updating at variable times, with little control over payload communications. Context sensitive and recursive global variables baseFileNm={url:basefile} baseNoSpc={baseFileNm:replace: :_} So I can do(remove spaces from file name): Set "Download location" to "Save to file" with value: {startuppath}STORE\{category}\{appname}\{baseNoSpc}.{url:ext} New Command line switches Log only failures, no debugging info(should work when updating with existing "/silent" switch) /logerror=[Location of log file] Install without UI and without updating first /installsilent=[Location of xml file] .Net compatibilty in V1.8 It seems Ketarin 1.8 will require installation of .netv4 on W7 systems before use; while current v1.7 works with W7,W8,W10 without issue. Given this is the first thing to install on any new or aging installation of W7(with Ketarin), I wondered if compatibility can be kept, at least at the command line? eg. ketarin /install=dotNet4.xml , ketarin /install=InstallSetWithdotNet4.xml Thanks and best regards.
  13. Hello everyone, I love Ketarin because it provides me an easy way to manage and choose programs I want to install on customer computers. More then half of my program list consists of programs which are not downloaded and updated by Ketarin, aswell as various scripts. I'd like to be able to set icons for these items, could someone help me to do this? Thanks, Ambimind
  14. Hi Omniferum, Indeed I did move the entire directory, that is - I have a folder "StandardInstall" which contains all the folder categories and a special folder called "CONTROL" - where Ketarin lives. I've also moved the database file into the CONTROL folder. My expectation was that having structured things this way I could move StandardInstall around as I wished, and Ketarin would orient itself. This is a false expectation?
  15. Thanks tomorrow, not quite what I was looking for however. Something new: Yesterday, after having setup a list of apps, tested locally, I visited a customer with the hope of using Katerin to speed things up. Nothing worked. And the messages I get are baffling: 1 - Sometimes I'll get: "Failed, The remote name could not be resolved: 'www.filehippo.com'" - when I'm pressing the install button, while I'm connected to the internet and not. 2 - Other times : "The operation has timed out" - for the same application, using install. 3 - Still othertimes: Ketarin will decide that it wants to re-download an application when there are no updates. To say the least , it made the whole operation a great deal more difficult and time consuming. I hope this is entirely my fault, however after some testing this seems unlikely. During my tests I found that the applications that did work only had "{file}" as the run command.
  16. What a useful program this is! As I see it, its primary value is as an easy to manage software catalog - fully portable, highly customizable and best of all allowing for ordered software installation. Indeed, I've created entries to programs who's sole purpose is to apply registry changes and manipulate files; programs which never check for updates online. An example of how I use it: Since most of the software I employ is not silently installable and if it is, not customizable enough, I have compiled into .exe's, for each program, small Autoit scripts which reliably automate the installation. Its these scripts/exe's that I run with : {startuppath}\Unattended \CCleaner.exe with argument:"{file}" The scripts are written so that they can adapt to windows titles with varying version numbers, button text and are resolution independent - thus they require rare updating. Ketarin's special variables were key to this being possible! Question: While programs are installing the Ketarin window is made to stay maximized. I can see how this is useful when performing silent installs however it only introduces potential problems when performing unattended installs: Is there some where to hide it during installation? Thank you
×
×
  • 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.