Jump to content
Ketarin forum

Search the Community

Showing results for 'rename variable'.

  • Search By Author

Content Type


Forums

  • Discussion
    • General discussion
    • Feature requests
    • Bugs
  • Resources
    • Tips and Tutorials
    • Templates

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Database GUID

  1. Currently (Ketarin 1.8.11.0) there are four separate Event Commands available: 1) Before updating an application 2) After updating an application 3) After updating all applications 4) When application update fails These are great for pre-download validation and post-update & post-check failure documentation, but they don't address every scenario. I would like one more Event Command available: Before checking for updates for an application. When I have parallel downloads set to 1 then it's a safe bet that the next one in the list is responsible. When I have parallel set to 2 or 3 (or more) then it's a whole lot of guessing. This new event would trigger before any variables were parsed (other than the name) so that I can log the progress of "update all" or "check for updates" on a selection. This would allow me to write the pre-parse progress to a permanent log file so I can better troubleshoot errors. Currently, when Ketarin crashes (which isn't often, but is often enough that it's frustrating) I have to guess which application is responsible and which variable or URL it was within the application that might be causing the problem. I can work around some of this with special variables and the ":ps" function, but more difficult than it could be to figure out which one is responsible. Alternatively (or in addition to) there would be an option to write to a log file that mirrors the activity in the real-time log (CTRL+L). This could either be one massive file (ketarin.log), or based on the date, or based on variables (like "ketarin-{yyyy}{MM}{dd}{hh}{mm}.log" or "ketarin-{category}.log" or even based on the "save as" destination with an additional ".log" appended: "..\{category}\{appname:regexreplace:([\s\t\r\n\-\&]+):_}-{version}.{url:ext}.log" where as-yet-unparsed variables would be replaced with dashes or underscores). Each application should have the log file name preserved for the duration of the specific application, so if the log file name were "ketarin-{yyyy}{MM}{dd}T{hh}{mm}.log" at 20240414T1345 and it took 4 minutes to process the application, all log records relating to that application update would be written to that log even though the time were actually 20240414T1349 by the time it was done.
  2. Yes, my global UA is the default one: Mozilla/4.0 (compatible; Ketarin; +https://ketarin.org/) is it a good practice to change it to something else? In any case, I copied the same UA, that I put in the kuppet.config file, in the app profile, which is the exact version stated in the browser About page: I tried to check the versionstub variable, but the problem seems to be that it cannot load the page? although I see it in the Chromium browser (it loads correctly after the 3 second Anti-Crawler IP checker page): https://imgur.com/a/Kz9g0Bv
  3. I recommend removing the older user-agents from the userAgentArray variable. Firefox/65 and Chrome/100 are both *very* old and many security features on websites now block them by default. The next troubleshooting step is to change the chromeVisible value in your config to true. This will allow you to watch as Kuppet operates, which might be enough to see what is failing.
  4. Looks like TechPowerUp is now using manual server selection, so clicking the button alone doesn't actually download the file, it just shows a page with the server selection. Parse that for "server_id" then use POST to download the file. Since Ketarin can't post to the download URL you'll have to shell it out in a powershell variable or use the pre-download command using something that can (Wget or Curl). This is usually pretty simply once you understand the syntax: curl.exe -v -X POST -L -o "file.ext" -d "id=164&server_id=12" -4 "https://www.techpowerup.com/download/techpowerup-real-temp/" This performs a verbose POST request, following redirects, saves the output to "file.exe", and POSTs the data "id=164&server_id=12" using IPv4 to the URL. This doesn't actually download the file. There's an nginx proxy there that's refusing to actually allow the download. It's either blocking the UA or the referrer tree. It doesn't matter - the verbose response means that it's still showing you the "real" download URL which you could capture and drop into the download URL in Ketarin and that will actually work. If you wrap this in a powershell variable you can capture the download URL. I don't have time today to demonstrate but I will try to come back in the next couple days to show you if you haven't figured it out. I've attached the app profile for SetDefaultBrowser which uses Kuppet (though it looks like it's now EOL and being replaced by a more powerful tool). SetDefaultBrowser.xml
  5. Welcome aboard @Mundee. This is demonstrated pretty well in this thread. While Ambimind uses variables for the parts of the calling function, if you already know the name, type and form of the variable, then you could use the abbreviated syntax. For Start/End and RegEx you use: $x = $app.variables.MyVersionVariable.CachedContent For Textual Content use: $x = $app.variables.MyVersionVariable.TextualContent In both samples "MyVersionVariable" is the name of the variable you'll be using instead of {MyVersionVariable}.
  6. Hi, I am fairly new to Ketarin and still trying to figure things out. I would like to run a powershell command after downloading that uses the "global" {appname} and the {version} variable I created for the package. However the content of the variable(s) do not seem to be getting forwarded/piped to powershell. Am I doing something wrong? Thank you
  7. So the reason why the "downloadid" was failing is because you set the POST data within it. The downloadid should be used to parse *for* the ID value. Then the download_url will work correctly. If the ID remains consistent between all builds then you could probably hard-code it, but I would rather just parse for it to be sure. Here's the fixed XML: <?xml version='1.0' encoding='utf-8'?> <Jobs> <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="bd752d5c-099d-4187-83e7-2ddb9cf3d546"> <Category>System Maintenance &amp; Security</Category> <WebsiteUrl>http://www.techpowerup.com/realtemp/</WebsiteUrl> <UserAgent>Mozilla/5.0</UserAgent> <UserNotes>[Description] Real Temp is a temperature monitoring program designed for all Intel single Core, Dual Core, Quad Core and Core i7 processors. Each core on these processors has a digital thermal sensor (DTS) that reports temperature data relative to TJMax which is the safe maximum operating core temperature for the CPU. As your CPU heats up, your Distance to TJMax will decrease. If it reaches zero, your processor will start to thermal throttle or slow down so maximizing your distance away from TJMax will help your computer run at full speed and more reliably too. [Official Download Sources] http://www.techpowerup.com/downloads/SysInfo/Real_Temp/ [Changelog] http://www.techpowerup.com/realtemp/ ---------- corrections and improvements are welcome - @DHT (Ketarin forums)</UserNotes> <LastFileSize>330853</LastFileSize> <LastFileDate>2024-03-01T09:34:05.8630984</LastFileDate> <IgnoreFileInformation>false</IgnoreFileInformation> <DownloadBeta>Default</DownloadBeta> <DownloadDate xsi:nil="true" /> <CheckForUpdatesOnly>false</CheckForUpdatesOnly> <VariableChangeIndicator /> <HashVariable /> <HashType>None</HashType> <CanBeShared>true</CanBeShared> <ShareApplication>false</ShareApplication> <ExclusiveDownload>false</ExclusiveDownload> <HttpReferer /> <SetupInstructions> <SetupInstruction xsi:type="StartProcessInstruction"> <EnvironmentVariables /> <FileName>"{file}"</FileName> <Parameters /> <WaitForExit>true</WaitForExit> </SetupInstruction> </SetupInstructions> <Variables> <item> <key> <string>version</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>StartEnd</VariableType> <Regex>(?&lt;=temp )[\d.]+</Regex> <Url>https://www.techpowerup.com/download/techpowerup-real-temp/</Url> <StartText>&lt;title&gt;Real Temp </StartText> <EndText> Download</EndText> <TextualContent /> <Name>version</Name> </UrlVariable> </value> </item> <item> <key> <string>download_url</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <Url /> <TextualContent>https://www.techpowerup.com/download/techpowerup-real-temp/?id={downloadid}</TextualContent> <Name>download_url</Name> </UrlVariable> </value> </item> <item> <key> <string>previous</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <PostData>3.70</PostData> <TextualContent>3.70</TextualContent> <Name>previous</Name> </UrlVariable> </value> </item> <item> <key> <string>downloadid</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>name="id" value="(\d+)"</Regex> <PostData /> <Url>https://www.techpowerup.com/download/techpowerup-real-temp/</Url> <TextualContent /> <Name>downloadid</Name> </UrlVariable> </value> </item> </Variables> <ExecuteCommand>"{winrar}\winrar.exe" x -ad -ibck -o+ "{file}" "{file:directory}"</ExecuteCommand> <ExecutePreCommand /> <ExecuteCommandType>Batch</ExecuteCommandType> <ExecutePreCommandType>Batch</ExecutePreCommandType> <SourceType>FixedUrl</SourceType> <DeletePreviousFile>true</DeletePreviousFile> <Enabled>true</Enabled> <FileHippoId /> <LastUpdated>2024-03-01T09:34:05.8630984</LastUpdated> <TargetPath>{root}{apps}\{category}\{appname}\</TargetPath> <FixedDownloadUrl>{download_url}</FixedDownloadUrl> <Name>_ Real Temp (Portable)</Name> </ApplicationJob> </Jobs> The Logitech Options app profile I posted a while back doesn't work now. Logitech has changed their site so many times recently that this particular code doesn't work anymore, and I don't know if/when I'll be inclined to pursue making one that works again. Kuppet requires you to create a firewall rule in order for the local server to run. Assuming you're using the native Windows Firewall, you could whitelist the application or the port. It looks like you're using port 9000 so you can do it with this: netsh advfirewall firewall add rule name="Kuppet" dir=in protocol=TCP localport=9000 action=allow enable=yes profile=any localip=any remoteip=any interfacetype=any To later remove it use: netsh advfirewall firewall delete rule "Kuppet" This will ensure that the firewall allows Kuppet to operate as a standalone server on your computer. I also recommend you change the definition for the "run_kuppet" variable to: if(!(PS kuppet -ea 0)) {START -WindowsStyle hidden BIN\kuppet 9000} This will open Kuppet interactively - what you'll see is basically just a powershell window showing the log of actions. Use this to see whether it is loading correctly, and whether the requests are being processed correctly. There's a bit of a learning curve. One issue with Kuppet is that by default it uses the "HeadlessChrome" user-agent, which many web servers block by default. You'll need to configure a kuppet.config file with the user-agent you wish to use. I show how to automate this process here.
  8. One workaround for this issue is to use powershell delays on specific downloads. There's a demonstration of this in the Wiki here at the bottom of the page. You create a global variable (updateDelay) with the content "sleep -s 5", then run that wherever you want to impose a delay. Doing so is as simple as "{updateDelay:ps}" within any other variable or context. You can use it multiple times within a variable if you need longer delays, or only put it on the download URL if you only want it to only delay actual downloads. I personally have Ketarin set to limit overall simultaneous downloads to only 2 and use delays like this on sites that misbehave when you make too many simultaneous requests for different pages. While this means that a full update check for all 1000+ apps can take ~105 minutes, I almost never have any error out.
  9. This already exists. F2 will allow you to rename a variable. Highlight it in the list on the left of the Variables window and press F2 and it will prompt you for the new name. There are actually quite a few hidden gem keyboard shortcuts in Ketarin. For example, highlight several apps in the list and CTRL+C to copy them to an XML export, or CTRL+SHIFT+C to copy a tab-delimited list.
  10. What are you using for "variable indicator for changes" and does the website use E-Tag, file timestamps, or other indicators of file changes? If you don't tell an app what you consider different it will have to base this information on data the server may not be providing. If you aren't actually downloading the file then E-Tag and other information that it would base this determination on are not available.
  11. I try to be consistent with variable names for multiple reasons. Sometimes, I would like to rename a variable (in the left side list of Edit Variables window) but there is no way to do it, I have to delete the variable and fully recreate it with the new name. A workaround is to export the app, edit the XML, then reimport it. But either solution is too much work for a simple rename! Thanks
  12. Hi, @WrongCode ! There are actually a lot of tips available here on the forum. Whenever I find a novel solution to a problem I try to post about it there. Ultimately you'll want to figure out what details you actually want to keep and how aggressive to be with that data collection. It's insanely easy to get just the download and not think about everything else, but I always want to capture the changelog and any other relevant details as well (bits, OS, vendor, website and so on). Guidance for creating and using custom columns, changelogs, PowerShell variable access, and lots more at the Tips section. The Templates section also has some demonstrations of how to do common tasks, including the use of Templates, which are pretty awesome if you download a lot of things from the same sites (like GitHub or Source Forge or NirSoft): creating a template allows you to do the major work only once, then plug in a few values when you load another app from the template. Finally, get Kuppet. Kuppet is a Ketarin accessory that allows you to bypass a lot of the newer HTML5 JavaScript-rendered page problems by rendering the page for you first and allowing you to capture the content from that instead of the unusable JavaScript calls alone. I'm using Kuppet in about 20-25% of my apps now.
  13. Glad you got it sorted so quickly, @WrongCode. However, I would recommend you change from the home page to the changelog to parse for version and download URLs. In my experience it's usually more reliable and consistent since the devs may not have the home page hooked into whatever release process they use so one or more values may fail to be updated as part of their manual process. The reason you saw it failing to download was because the last version was the same file that downloaded last time -- 4.14.0.21323 -- so even though the version number changed on the homepage the binary link did not. The pattern you used for your url variable (which you used for the download URL) failed because that text didn't actually appear on the page so it couldn't parse for it, so it failed to update. You can use the ifemptythenerror function to perform validation on your variables to troubleshoot situations like this one. You can also get around that problem (here) by switching from parsing for the URL (which you clearly know is going to match that pattern anyway) to just fabricating the URL yourself as a Textual variable as so: https://dist.mountainduck.io/Mountain%20Duck%20Installer-{version:ifemptythenerror}.exe Change the variable type from "Content from URL (regular expression)" to "Textual content" and use that pattern and it will solve both of your big issues here. Even so, it's possible they might change the download URL format/pattern at any time, so be careful if you do. Ketarin natively monitors eTags and dates as well so won't re-download the same binary unless you use the "force" option or the server doesn't actually report these values (rare). Later, when they discover their error and update the URL on the homepage then it doesn't solve the Ketarin side of the problem since you're using version as the "variable as indicator for changes" and your app has already detected the new version number (even if it didn't download because the url variable was defective!) so it won't download unless you resolve the underlying URL parsing problem. If you install the one that you did download you'll find that it is, in fact, the older installation package from a couple weeks ago. The changelog page also adds a few other things you might be interested in, including the hash and other related packages. Finally, I also recommend you parse for the actual download URL and not rely on injecting the version number in the URL of the pattern they've used prior to get the file. Way too often sites will randomly include additional values (like cache busters or language flags) or change portions of the path that they did not do before (download vs dist). To help detect these situations I use a pre-download command that checks for an empty version number, and a post-download command that writes out all errors and relevant update data from each update to a log file and push it all to a web-accessible database. This allows me to monitor all of my Ketarin activity without having to rely exclusively on the Ketarin interface.
  14. Hello, first time I write on this forum. I have the following application definition to deal with Mountain Duck. All of a sudden, Ketarin started refused to download a new version released in the past days because it states the cached version was already at the value it fetched with the definition's regex. That was with Ketarin 1.8.11. I decided to switch Ketarin 1.9 beta, I've exported the definition (the one I am attaching) and I've delete the application from Ketarin. I exited and restarted Ketarin, re-imported the application definition, and tried to download the application, to no avail. The log states: 11/6/2023 21:27:24: Update started with 1 application(s) 11/6/2023 21:27:24: Mountain Duck: Replacing {version} in 'href=(https://dist.mountainduck.io/Mountain%20Duck%20Installer-{version}.exe)' with '4.14.1.21330' 11/6/2023 21:27:24: Mountain Duck: Checking if update is required... 11/6/2023 21:27:25: Mountain Duck: Replacing {version} in '{version}' with '4.14.1.21330' 11/6/2023 21:27:25: Mountain Duck: No previous value for {version} available, ignoring this variable as indicator for changes 11/6/2023 21:27:25: Update finished I am out of ideas. Thanks for any hint you can give me. Mountain Duck.xml
  15. Hi, all, I've been meaning to rewrite several of my apps for quite a while because there just aren't ways to collect the version number and I hate to have to have a bunch of commands on individual apps just because maintenance becomes a chore. So I came up with a global after-update script to process stuff like that. It's controlled through a new variable assigned to the app called "todo". The idea is that instead of leaving the file details unfilled, let's parse it after it's downloaded from the file itself or perform other post-download actions (extraction, uploading to an FTP server, download from MEGA, copy to another folder and so on). These are now all handled centrally for me with the global after-updating an application script and this new variable. This uses a couple functions based on @Ambimind's code posted here and elsewhere on this forum. #### Support function PKV { Param( $svName ) #### identify variable type and collect stored content $svType = $app.variables.$svName.VariableType; if( $svType -eq "Textual" ){ #### stored text content $svContent = $app.variables.$svName.TextualContent; #### process all child variables if( $svContent -like '*{*' ){ $svContent2 = $app.variables.ReplaceAllInString( "{$svName}", $sfiletime, $sfilename, $true, $false ); if ( $svContent2 -ne '' ){ $svContent = $svContent2; } } }else{ #### other types of variables must be parsed $svContent = $app.variables.ReplaceAllInString( "{$svName}", $sfiletime, $sfilename, $true, $false ); } #### parse version for psversion if it exists if( $svName -eq "version" ){ if( $app.variables."psversion".TextualContent -ne "" ){ $svContent = $app.variables.ReplaceAllInString( "{$svName}", $sfiletime, $sfilename, $true, $false ); } } #### sanitize $svContent = ($svContent -Replace 'http://localhost:48080/', '' | Out-String).Trim() if( $svContent -eq "{$svName}" ){ $svContent = ''; } #### return Write-Information $svName':'$svContent; ($svContent | Out-String).Trim() } #### function NewAppVariable { Param( [Parameter(Mandatory)] $sVarName, [ValidateSet("RegularExpression", "StartEnd", "Textual")] $sVarType = "Textual", $sVarValue = "" ) # Derived access property, ie. app.variables.$sVarName.$varcnt $varcnt = if($sVarType -eq "Textual"){"TextualContent"}Else{"CachedContent"} # If it doesn't exist, then create a new one if(-Not $app.variables.$sVarName){ ECHO "=== $sVarName NOT FOUND, ADDING IT ===" # Add var to job/app $newvar = New-Object -TypeName Ketarin.UrlVariable -ArgumentList $sVarName,$app.variables $newvar.VariableType = $sVarType $app.variables.Add($sVarName, $newvar) $app.Save() } # If it was passed a specific value, assign it if( $sVarValue -ne "" ){ $app.variables.$sVarName.$varcnt = $sVarValue } } #### #### Parse cached variable values $sname = $($App.Name); $sfilename = $($App.CurrentLocation); write-host "Filename:`t$sfilename"; $todo = PKV ( 'todo' ); write-host "ToDo:`t$todo"; Switch ($todo) { { @('fileversion', 'fv') -contains $_ } { $sversion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($sfilename).FileVersion.toString(); $app.variables.version.TextualContent = $sversion; break; } { @('upload') -contains $_ } { Start-Process -FilePath "Uploader.bat" -ArgumentList $sfilename -Wait -NoNewWindow; break; } { @('extract','extractx','x') -contains $_ } { PUSHD $app.Variables.ReplaceAllInString("{file:directory}"); Start-Process -FilePath "7z.exe" -ArgumentList 'x','-y','-r',$sfilename -Wait -NoNewWindow; POPD; break; } { @('extracte','e') -contains $_ } { PUSHD $app.Variables.ReplaceAllInString("{file:directory}"); Start-Process -FilePath "7z.exe" -ArgumentList 'e','-y','-r',$sfilename -Wait -NoNewWindow; POPD; break; } { @('mega','megaget') -contains $_ } { $sdownload = PKV ( 'sdownload' ); $sdownloadpath = PKV ( 'sdownloadpath' ); if( $sdownloadpath -ieq "" ){ $sdownloadpath = $app.Variables.ReplaceAllInString("{startuppath:directory}"); } Start-Process -FilePath "%localappdata%\MEGAcmd\mega-get.bat" -ArgumentList $sdownload,$sdownloadpath -Wait -NoNewWindow; break; } { @('copy','copyx') -contains $_ } { $copyx = $app.variables.copyx.TextualContent; Switch ($copyx) { { @('tools','gd') -contains $_ } { Copy-Item $sfilename -Destination "G:\Google Drive\Tools" -Force; break; } { @('downloads') -contains $_ } { Copy-Item $sfilename -Destination "C:\Downloads" -Force; break; } default { Copy-Item $sfilename -Destination $copyx -Force; break; } } break } { @('diagnostics','dx') -contains $_ } { $app | Select-Object * | Out-File c:\downloads\ketarin-app.txt -width 400; $app.Variables | Select-Object * | Out-File c:\downloads\ketarin-app-var.txt -width 400; $app.Variables.Keys | Select-Object * | Out-File c:\downloads\ketarin-app-var-keys.txt -width 400; $app.Variables.Values | Select-Object * | Out-File c:\downloads\ketarin-app-var-values.txt -width 400; break; } default { break; } } That's all. I thought some of you might be interested.
  16. Hi, try something like this: Variable: version Contents from URL: https://regedix.webrox.fr Use regular expression: (?<=Regedix_installer-)([0-9.\-]{2,})(?=.exe) Variable: download Contents from URL: https://regedix.webrox.fr Use regular expression: (download.php[^']*\.exe) Variable: url Textual content: https://regedix.webrox.fr/{download}
  17. I updated all my Github apps back when I created this thread and just now had to create a couple more. The list below are sample Github variables. This relies on Kuppet (though it might not always be necessary). The {version}, {sdownloadsource} and {sdownloadstub} each use "content from url (regex)". The other two use "textual content". {version} variable: url: https://github.com/VirusTotal/yara/releases/latest pattern: releases/tags?/v?([\d\.]+) {sdownloadsource} variable: url: https://github.com/VirusTotal/yara/releases/latest pattern: "([^'"\s]+expanded_assets[^'"\s]+)" {sdownloadstub} variable: url: {>}{sdownloadsource} pattern: (/[^'"]+download/v{version}[^'"]+.zip) {sdownload} variable: text: https://github.com{sdownloadstub} {schangelog} variable: text: https://github.com/VirusTotal/yara/releases/latest The {sdownloadstub} is the actual file pattern pulled from the new expanded_assets path. While this pattern will work for some, you'll need to update it for most apps.
  18. I find that with Kuppet it's more likely to be a system setting causing problems than the apps. The apps are almost identical to any other, with the only Kuppet difference being the "{>}" added to the beginning of the URLs you want processed by Kuppet. I dont have any apps using softpedia but here's one that I use Kuppet for that also has the advanced delay option. <?xml version='1.0' encoding='utf-8'?> <Jobs> <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="0baea9b7-6cb5-4b80-956c-31a42688a730"> <Category>Tools</Category> <WebsiteUrl /> <UserAgent /> <UserNotes /> <LastFileSize>33799</LastFileSize> <LastFileDate>2022-04-19T12:52:44.9008899</LastFileDate> <IgnoreFileInformation>false</IgnoreFileInformation> <DownloadBeta>Default</DownloadBeta> <DownloadDate xsi:nil="true" /> <CheckForUpdatesOnly>false</CheckForUpdatesOnly> <VariableChangeIndicator>version</VariableChangeIndicator> <HashVariable /> <HashType>None</HashType> <CanBeShared>true</CanBeShared> <ShareApplication>false</ShareApplication> <ExclusiveDownload>true</ExclusiveDownload> <HttpReferer /> <SetupInstructions /> <Variables> <item> <key> <string>schangelog</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>https://kolbi.cz/blog/2017/11/10/setdefaultbrowser-set-the-default-browser-per-user-on-windows-10-and-server-2016-build-1607/</TextualContent> <Name>schangelog</Name> </UrlVariable> </value> </item> <item> <key> <string>swebsite</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>https://kolbi.cz/blog/2017/11/10/setdefaultbrowser-set-the-default-browser-per-user-on-windows-10-and-server-2016-build-1607/</TextualContent> <Name>swebsite</Name> </UrlVariable> </value> </item> <item> <key> <string>snotes</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>Version can not be accurately determined due to server-side blocking</TextualContent> <Name>snotes</Name> </UrlVariable> </value> </item> <item> <key> <string>spc</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>SetDefaultBrowser</TextualContent> <Name>spc</Name> </UrlVariable> </value> </item> <item> <key> <string>sdownload</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>https://kolbi.cz/SetDefaultBrowser.zip</TextualContent> <Name>sdownload</Name> </UrlVariable> </value> </item> <item> <key> <string>splatform</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>windows</TextualContent> <Name>splatform</Name> </UrlVariable> </value> </item> <item> <key> <string>sbits</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent /> <Name>sbits</Name> </UrlVariable> </value> </item> <item> <key> <string>versionstub</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>Version ([\d\.]+) </Regex> <PostData>redirection-delay=45</PostData> <Url>{&gt;}https://kolbi.cz/blog/2017/11/10/setdefaultbrowser-set-the-default-browser-per-user-on-windows-10-and-server-2016-build-1607/</Url> <TextualContent>{f:yyyy}{f:MM}{f:dd}</TextualContent> <Name>versionstub</Name> </UrlVariable> </value> </item> <item> <key> <string>LastUpdate</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>Get-Date -UFormat %Y%m%dT%H%M</TextualContent> <Name>LastUpdate</Name> </UrlVariable> </value> </item> <item> <key> <string>svendor</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>Christoph Kolbicz</TextualContent> <Name>svendor</Name> </UrlVariable> </value> </item> <item> <key> <string>LastVersion</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>1.5.0</TextualContent> <Name>LastVersion</Name> </UrlVariable> </value> </item> <item> <key> <string>versionshort</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>{versionstub}.0.0</TextualContent> <Name>versionshort</Name> </UrlVariable> </value> </item> <item> <key> <string>version</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>{versionshort:split:.:0}.{versionshort:split:.:1}.{versionshort:split:.:2}</TextualContent> <Name>version</Name> </UrlVariable> </value> </item> </Variables> <ExecuteCommand /> <ExecutePreCommand>if "{version}"==".0.0" exit 1</ExecutePreCommand> <ExecuteCommandType>Batch</ExecuteCommandType> <ExecutePreCommandType>Batch</ExecutePreCommandType> <SourceType>FixedUrl</SourceType> <PreviousLocation>K:\_Ketarin\Ketarin\..\Tools\SetDefaultBrowser-1.5.0.zip</PreviousLocation> <DeletePreviousFile>true</DeletePreviousFile> <Enabled>true</Enabled> <FileHippoId /> <LastUpdated>2022-04-19T12:52:44.9008899</LastUpdated> <TargetPath>..\{category}\{appname:regexreplace:([\s\t\r\n\-\&amp;]+):_}-{version}.{url:ext}</TargetPath> <FixedDownloadUrl>{sdownload}</FixedDownloadUrl> <Name>SetDefaultBrowser</Name> </ApplicationJob> </Jobs> Looks at the "versionstub" variable for how the advanced redirection-delay works (via post-data). If you have the global variables created correctly then you should have a "run_kuppet" variable and a ">" variable. The ">" just tests to make sure that kuppet is running then passes the URL to the actual Kuppet service running on whatever post you assigned in the "run_kuppet" variable. The "run_kuppet" variable tests for the process (PS) then STARTs the program with optional path and settings. If you changed the port on either it needs to be changed on both. If you didn't put kuppet.exe directly into the BIN folder beside ketarin.exe then you'll need to change the path. If you're using other advanced options (like changing the timeout) then it's important in the "run_kuppet" variable that parameters (port then timeout) be quoted together in the START command ("bin\kuppet.exe" "port timeout"). When I was first setting it up it was much easier to launch kuppet manually from a powershell prompt set to the path of the ketarin.exe file. This helps you ensure that you're using the correct path values in the START command. It also lets you see any errors and the debugging information if you have that enabled in the configuration file. Please post your ">" and "run_kuppet" values and the full system paths for both kuppet.exe and ketarin.exe. We'll help you get it sorted.
  19. Oh, I also added another feature to my templates. Often when I'm using EXIT 3 it's because Ketarin is not working to download a file. Either I have to pass it to aria2, mega-get, or the download is behind a paywall/login that doesn't play well with Ketarin. To minimize some of the related issues while ensuring that it passes the proper context to my after-update script so it can send the correct data to the server I created a new global variable named "snodownload" with the value "https://www.iana.org/_img/bookmark_icon.ico". I always use a variable named "sdownload" to represent the download URL. This allows me to still capture the download url to "sdownload" and use "snodownload" in the download field so it will be a publicly accessible binary file (so Ketarin won't complain) and the after-update script still works. I don't have to go looking for a reliable binary link, just use the same global variable. Good stuff.
  20. I've worked around this problem for now using the following method. This will reduce the number of times you have to edit your after-update script behaviors in a dozen or more places wherever you might use EXIT 3 and limits it to just two: the external text file and the real "after updating an application" script block. 1) Create a simple text file with the contents of the script you have in your "after updating an application" global script. 2) Create a new global variable named "manualafterupdate" with the value (make sure the path is the correct location): (Get-Content "D:\Ketarin\AfterUpdateCommand.txt" -Raw) This will read the contents of the script into that global variable. 3) In those apps where you're using EXIT 3 add a new variable named "empty" with the following text contents: {manualafterupdate:ps} 4) Modify the app-specific before-update command to: ECHO.Calling PS script.{empty:empty} EXIT 3 Now when you update that application it will run the powershell script you have stored in the file "D:\Ketarin\AfterUpdateCommand.txt" within the context of this app, same as if it were running the "after updating an application" global script. Unfortunately, the "empty" app variable is a necessary middle step. Ketarin would not execute the powershell script in the correct context unless the second variable step is used. I may be the only person using this behavior but I use it in a lot of apps, so this is going to save me hours every time I update the after-updating an application script.
  21. @shawn For now I've implemented the following solution: Using post-variables(see image below), each Ketarin-job-variable specifies a "redirection-delay", measured in seconds. Kuppet will wait for this duration after the initial page load, during which it is supposed that any landing-page-timers have completed and the actual page has begun to load, after which kuppet will wait till the page has finished loading(absence of network requests for 500ms).
  22. hi everyone, i try to modify the version variable like this : <Variables> <item> <key> <string>version</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex/> <TextualContent>{psversion:ps}</TextualContent> <Name>version</Name> </UrlVariable> </value> </item> <item> <key> <string>psversion</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex/> <TextualContent>[System.Diagnostics.FileVersionInfo]::GetVersionInfo("{file}").FileVersion </TextualContent> <Name>psversion</Name> </UrlVariable> </value> </item> </Variables> but with an app from online database it doesn't work : 28/02/2022 22:53:41: Notepadplus: Replacing {psversion} in '{psversion:ps}' with '[System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Users\Dumont\Downloads2\clef usb programme\clef\programmes personnels gratuits\Ketarin\..\installateur\Notepadplus\npp.8.3.2.Installer.exe").FileVersion ' 28/02/2022 22:53:41: Notepadplus: PowerShell command of downloaded application is not executed for security reasons. 28/02/2022 22:53:41: Notepadplus: Replacing {version} in '{version}' with '' How can i perform this with an online database app ?
  23. I've been using the `LastUpdated` and a modified variation on it for `LastVersion` based on this for years. I'm going through ALL of my apps right now and it's painful to have to add the current info variables I need for my external tools, so I decided to wrap it all in a function and force it across my database. This is how I'm doing it: #### function NewAppVariable { Param( [Parameter(Mandatory)] $sVarName, $sVarValue = "", [ValidateSet("RegularExpression", "StartEnd", "Textual")] $sVarType = "Textual" ) # Derived access property, ie. app.variables.$sVarName.$varcnt $varcnt = if($sVarType -eq "Textual"){"TextualContent"}Else{"CachedContent"} # If it doesn't exist, then create a new one if(-Not $app.variables.$sVarName){ ECHO "=== $sVarName NOT FOUND, ADDING IT ===" # Add var to job/app $newvar = New-Object -TypeName Ketarin.UrlVariable -ArgumentList $sVarName,$app.variables $newvar.VariableType = $sVarType $app.variables.Add($sVarName, $newvar) $app.Save() } # If it was passed a specific value, assign it if( $sVarValue -ne "" ){ $app.variables.$sVarName.$varcnt = $sVarValue } } #### This means I can then use the following much simpler lines to add my new variables: #### ADD MISSING VARIABLES & UPDATE Last* Cache NewAppVariable "sbits" NewAppVariable "schangelog" NewAppVariable "sdownload" NewAppVariable "snotes" NewAppVariable "splatform" NewAppVariable "swebsite" NewAppVariable "svendor" NewAppVariable "version" NewAppVariable "LastUpdate" {Get-Date -UFormat %Y%m%dT%H%M} NewAppVariable "LastVersion" $sversion #### The way it's written it will never overwrite or destroy an existing variable or its contents, other than LastUpdate and LastVersion which are specifically intended for that purpose. If you need another variable it's as simple as NewAppVariable <variable name> <newvalue> <type>. Thank you again @Ambimind!
×
×
  • 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.