Jump to content
Ketarin forum

Omniferum

Members
  • Posts

    304
  • Joined

  • Last visited

Posts posted by Omniferum

  1. Dear floele,

     

    Please excuse our english if it becomes too confusing for you. We believe you are German, but have posted in English.

    I represent a collective of wealthy benefactors who have a team of experts that have identified you as someone who is an unrecognized genius coder.

    If you would like this talent nurtured further and desire either mentoring OR money from YOSH, we would welcome you to get into contact with us.

    It was one of our own members who noticed you (omniferum). Our collective found him, and he led us to you.

    We offer you the same opportunity that he has taken, without the desire to make you feel guilty/responsible regardless of your choice. Any contract you sign will only be ones that guarantee we make no profit from you, and that we will own NO Intellectual Property. It will either be distributed amongst those who choose to draw their money from the YOSH pool of funds, or directly to you. Either way, we offer you freedom to become who we see in you.

     

    Our e-mail: yosh@tuta.io [mangled now in case you have email filters on your forum system] -> YOSH data 2 ta dhot io

     

    Sincerely,

    Y.O.S.H. (YourOpenSourceHumanity)

     

    p.s.

    We are using every pathway we can find to contact Mr. Floele directly. Any assistance (if this message is having trouble finding him) would be welcome.

  2. CONCERN

    Every few months I find an app that hasn't been updating at all because {preupdate-url} is not resolving to anything (I use a {download} variable in that field) and I have to perform some manual investigation. I'm sure most people use their own variable to populate the Download Source URL.

     

    Currently Ketarin will only run 'before updating an application/before downloading' commands if Ketarin detects that there is something to download. If it doesn't find anything, or fails to determine the file to download as downloadable, then it just fails and no commands are run.

     

    I'm aware Ketarin needs to determine variables and if there is anything it can do, but it 'fails' and exits the job without bothering to check pre-update commands.

     

    Scenario is basically this.

    if " {preupdate-url}" EQU "" START CMD /C "ECHO {appname}: Unable to resolve download URL, investigate & PAUSE

     

    All variables are populated, but nothing is done with them because of it.

     

    SUGGESTION

    Is it possible to put the execution order of Ketarin 'fail' as after the pre-update commands, or some sort of allowance/option in the main menu or per-app that can inform someone that the {preupdate-url} variable is empty?

     

    This falls mostly under a maintenance feature so offering full-blown scripting for pre-fail commands might not make sense and a simple "does {preupdate-url} contain a slash, a dot, and at least a letter or number?" check.

  3. RD [/s] [/Q] [drive:]path

     

    In all the examples you provide, you've put the /S /Q flags 'after' the path which can be just a bit confusing depending on situation.

     

    Primarily though, START "" /WAIT can conflict with the /B flag - basically the /WAIT does not fire and so all those commands are being executed without actually waiting for the 7z

    "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\7z.exe" x "{file}" -o"C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\" -y
    CD "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\blender-*-win64"
    RD "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev"
    XCOPY /Y /S /Q *.* "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev\"
    RD /S /Q "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa"
    

    The above should work fine.

     

    Keep in mind that Ketarin doesn't actually fire off a 'batch file', it just sends the command as if you were typing them into the cmd.exe window yourself and pressing enter as necessary.

  4. I should perhaps have pointed out my issue is that my approach only works if you have a variable as the URL, forcing Ketarin to resolve it so you can perform a check against it. I was asking more for Ketarin to have a built-in variable that it will attempt to resolve which you can check against.

  5. Oh, could we have an extra application option called "if download variable is empty/doesn't resolve then consider it an error"?

     

    Currently I just have a batch script that basically says:

     

    IF "{downloadurl}" EQU "" cmd /c echo error

  6. This is actually an old thing I believe, but would it be possible to implement a form of silent/unattended that will exit if it encounters no errors upon updating, but if there is an error Ketarin can prompt 'would you like me to skip and keep going or would you like to investigate?'

     

    Or have a prompt at the end that says 'These applications encountered an error, investigate.' but if there are no errors then it just exits smoothly.

  7. {download} is not a built-in variable. Most people just name their custom variable {download} because it is the simplest.

     

    If you go to the variables window of any application profile in Ketarin the variables list on the left is the name, and on the right is 'where' the information will come from, and also 'what' information will be processed.

     

    Most people click on the circle "Content from URL (Regular Expression)" because we are used to using regex to get the link, but you can use the 'start/end' one if regex is not your thing.

     

    The first bar underneath that is: Contents from URL (The website address that has the download links you want)

    Search within contents: This is just a quick 'search' function that helps you find the part on the page that would have the link so you can construct your regex properly

    Use regular expression: The regex <- the result from this regex is what the highlighted variable on the left will be populated with.

     

    Example

    Regex: [^ "'<>\*]+\.exe

    Variable name on the left: download

    This is my default regex and it will find 90% of the first exe link on the page. It would return a link like this: http://www.fosshub.com:8080/download/mp3DC220.exe

     

    So now {download} will expand to: http://www.fosshub.com:8080/download/mp3DC220.exe

     

    Hope that helps.

  8. If you are using the built-in variables {root} it will output like this:

     

    (letter of the drive that ketarin is being run from) + :\ -> e.g. if it is on your C drive you will get:

     

    C:\

     

    So you would need to: {root}System\{category}\{appname} [{version}].{url:ext}

     

    I should also point out that I have used nothing BUT add instruction -> Custom command and input everything as batch commands. No problems to date.

     

    If you would like a universal command to silently install all .msi packages that support command line silent installation (tons of 'em do) you can use my logic below (I've been using Ketarin for years, the command has never failed.)

     

    To use the below thing you need to create two global variables called temppath and installpath, you can do this by:

    Main Ketarin window -> Click on file in top left -> Click on settings -> Click on the global variables tab)

     

    for reference these are how I define them in my Ketarin

    {temppath} = {root}Ketatemp\

    {installpath} = {root}Programs\

     

     

    start "" /wait msiexec /a "{file}" /qb! TARGETDIR="{temppath}{appname:regexreplace: \(.*\):}"

    for /f "tokens=2 delims=[]" %a in ('dir /b /s "{temppath}{appname:regexreplace: \(.*\):}\*.exe" ^| find /v /n "" ^| findstr /c:[1]') do set dir=%~dpa*
    {copyfolder} "%dir%" "{installpath}{category}\{appname:regexreplace: \(.*\):}\"
    rd /s /q "{temppath}{appname:regexreplace: \(.*\):}"
     
     
    To explain it a little basically it goes:
    Extract files to a temp directory
    Find the first .exe file in the folder the .msi was extracted to and set it as the 'base' folder. (EXPLANATION: The reason for this is some MSI's do NOT unpack to normal paths that you can just copy/paste/run)
    Copy all the files to their final destination
    Cleanup the temp folder
  9. I've developed a fair few templates with some basic batch points to automate installation from archives, binaries that can be uniextracted, standalone exe's, MSI admin stuff.

     

    Basically tried to automate as much as possible. It is all logic that could easily be implemented into Ketarin's base.

  10. I've always gone Application name (architecture|other specific information like dependencies or things that aren't immediately obvious)

     

    e.x.

    -CCleaner - Standard

    -CCleaner (x64) - It is pointless to put in x32, because 90% of programs will probably be 32-bit only still. So cluttering up the DB with unimportant information seems a tad pointless and will just make WHAT we look for a bit more confusing. You could try to put in other columns as standard like Architecture|Dependencies|Install Method then we wouldn't need to clutter up the application name.

    -Sickbeard (TorrentFork|GithubSource|Python) - Sickbeard has both source and binary that can be run from windows

     

    But I only do that for installers that are have explicit requirements that would not be obvious just from the application name. I mean the base understanding is 'this is a file you download and install/unzip/uniextract to run' with no other real dependencies or anything else. Granted these are special cases, but the 'extra' naming conventions should only be to make things that would not be immediately obvious.

  11. Delete them all and start fresh. Trying to just prune the bad ones would take far more time and most likely plenty will slip under the radar and stifle adoption from new users if they find frustration at some apps not working.

     

    And besides those would contribute fresh/new would have most likely tweaked whatever they submit to be very clean running.

     

    Happy to see development is ongoing.

  12. I actually made this already. If you want a rundown what it does is check the executable timestamp along with a custom file timestamp that is created whenever the install instructions are run. If there is a disparity then it runs the install instructions, woof.

     

    These are all seperate 'custom commands' that you add in the 'setup' tab, they are always executed 'in order' so make sure they are organized. When you make custom commands there are little green arrows next to them so you can move them up/down the list.

    ::This first part of the script determines if an install is necessary
    MD "{temppath}{appname:regexreplace: \(.*\):}\"
    ::This part of the script determines if the file downloaded is 'newer' than the last time an install was performed
    REM The XCOPY /D tag compares "modified time stamps"
    IF EXIST "{root}Programs\{category}\{appname:regexreplace: \(.*\):}\{appname:regexreplace: \(.*\):}-LastInstall.txt" XCOPY /L /D /Y "{file}" "{root}Programs\{category}\{appname:regexreplace: \(.*\):}\{appname:regexreplace: \(.*\):}-LastInstall.txt" | FINDSTR 0 && ECHO NO>"{temppath}{appname:regexreplace: \(.*\):}\{appname:regexreplace: \(.*\):}-NotNew.txt"
    IF EXIST "{temppath}{appname:regexreplace: \(.*\):}\{appname:regexreplace: \(.*\):}-NotNew.txt" EXIT
    
    ::All your install commands should go here, the line directly below just checks to see if it should skip install instructions or not
    IF EXIST "{temppath}{appname:regexreplace: \(.*\):}\{appname:regexreplace: \(.*\):}-NotNew.txt" EXIT
    ::Cleanup and update last install time command, this should be the last command run
    IF EXIST "{root}Programs\{category}\{appname:regexreplace: \(.*\):}\{appname:regexreplace: \(.*\):}-NotNew.txt" DEL /F /Q "{root}Programs\{category}\{appname:regexreplace: \(.*\):}\{appname:regexreplace: \(.*\):}-NotNew.txt" & EXIT
    ECHO %DATE%>"{root}Programs\{category}\{appname:regexreplace: \(.*\):}\{appname:regexreplace: \(.*\):}-LastInstall.txt"
    RD /S /Q "{temppath}{appname:regexreplace: \(.*\):}\"
    &
  13. When you unzip Ketarin there is no Jobs.db file in the folder. If you don't explicitly create an empty file called Jobs.db in the same folder as it Ketarin creates one in the %appdata%\ketarin folder. If you move your Jobs.db from that folder to where your Ketarin folder is then Ketarin will always use the Jobs.db in the same folder as it, rendering it fully portable.

  14. Been a while since i've contributed so thought I would now.

     

    First things first, the below code is an autohotkey script that will install any portableapps.com package silently and without user interaction. A screen 'might' pop up but it will be automatically minimized. If you experience some minor issue with keyboard/mouse not working while the script is running it is because everytime a command is sent to the window I disable the keyboard/mouse for a second so as whatever you are doing doesn't interfere accidentally.

     

    This will NOT work for portableapps that are just add-ons. Stuff like GPG for Thunderbird obviously need to know where thunderbird is etc. but all base installs will work just fine.

     

    
    #NoEnv ;Recommended for performance and compatibility with future AutoHotkey releases.
    SendMode Input ;Recommended for new scripts due to its superior speed and reliability.
    SetTitleMatchMode 2 ;Set titlematch to "contains" (default is "starts with"). Affects #IfWinActive's below. 
    
    If 0 < ;actually looking at %0%, which contains number of arguments. Must be 2.
    {
    MSGBOX ERROR: Must have at least 2 arguments (package file, destination folder); exiting.
       Return
    }
    Else
    {   file = %1%
       destdir = %2%
    wait = 500
    
    Run, %file%,, Min,runpid
    
    Loop
    {
    Sleep %wait%
    IfWinExist, ahk_pid %runpid%, The portable app can not be upgraded while it is running
    {
    MsgBox, 4144, User Interaction Required, You are trying to upgrade a program that is currently open!`n`nPlease FIRST close all instances of the program then click OK on these two windows
    }
    IfWinExist, ahk_pid %runpid%, Please select a language
    {
    BlockInput On
    ControlSend,, {Return}, ahk_pid %runpid%
    WinMinimize, ahk_pid %runpid%
    BlockInput Off
    }
    IfWinNotExist, ahk_pid %runpid%, Choose Install Location
    {
    BlockInput On
    ControlSend,, {Return}, ahk_pid %runpid%
    WinMinimize, ahk_pid %runpid%
    BlockInput Off
    } else {
    Break
    }
    }
    
    WinWait, ahk_pid %runpid%, Choose Install Location
    {
    Sleep %wait%
    BlockInput On
    Control, EditPaste, %destdir%, Edit1, ahk_pid %runpid%
    BlockInput Off
    Sleep %wait%
    BlockInput On
    ControlSend,, {Return}, ahk_pid %runpid%
    WinMinimize, ahk_pid %runpid%
    BlockInput Off
    }
    
    WinWait, ahk_pid %runpid%, Finish
    {
    Sleep %wait%
    BlockInput On
    ControlSend,, {Return}, ahk_pid %runpid%
    WinMinimize, ahk_pid %runpid%
    BlockInput Off
    }
    }
    

     

     

    The below template is what I use for ALL my portableapps.com installs. Remember to edit the variables to your needs.

     

     

    
    <?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">
       <WebsiteUrl />
       <UserNotes />
       <IgnoreFileInformation>false</IgnoreFileInformation>
       <DownloadBeta>Default</DownloadBeta>
       <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
       <VariableChangeIndicator>version</VariableChangeIndicator>
       <CanBeShared>true</CanBeShared>
       <ShareApplication>false</ShareApplication>
       <ExclusiveDownload>false</ExclusiveDownload>
       <UserAgent>{sfua}</UserAgent>
       <HttpReferer />
       <Variables>
         <item>
           <key>
             <string>download</string>
           </key>
           <value>
             <UrlVariable>
               <RegexRightToLeft>false</RegexRightToLeft>
               <VariableType>RegularExpression</VariableType>
               <Regex>[^"'=]+(?>\.exe)</Regex>
               <Url>{page}</Url>
               <Name>download</Name>
             </UrlVariable>
           </value>
         </item>
         <item>
           <key>
             <string>name</string>
           </key>
           <value>
             <UrlVariable>
               <RegexRightToLeft>false</RegexRightToLeft>
               <VariableType>RegularExpression</VariableType>
               <Regex><title>(.*?) \|</Regex>
               <Url>{page}</Url>
               <Name>name</Name>
             </UrlVariable>
           </value>
         </item>
         <item>
           <key>
             <string>page</string>
           </key>
           <value>
             <UrlVariable>
               <RegexRightToLeft>false</RegexRightToLeft>
               <VariableType>Textual</VariableType>
               <TextualContent><placeholder name="Application Page URL"/></TextualContent>
               <Name>page</Name>
             </UrlVariable>
           </value>
         </item>
         <item>
           <key>
             <string>version</string>
           </key>
           <value>
             <UrlVariable>
               <RegexRightToLeft>false</RegexRightToLeft>
               <VariableType>RegularExpression</VariableType>
               <Regex>Date updated.*?\n</Regex>
               <Url>{page}</Url>
               <Name>version</Name>
             </UrlVariable>
           </value>
         </item> 
       </Variables>
       <ExecuteCommand>/*This is a comment line, the line below is the C# script. It will run the instructions found in the Setup Tab. If the command below is encapsulated with stars and slashes merely remove them to make the command function, otherwise it will remain a comment*/
    app.Install(null);</ExecuteCommand>
       <ExecutePreCommand>if "{download}" EQU "" START CMD /C "ECHO {appname}: Unable to find download, investigate & PAUSE & exit&
    if "{FixedDownloadUrl}" EQU "" if "{FileHippoId}" EQU "" START CMD /C "ECHO {appname}: Unable to find download, investigate & PAUSE & exit&</ExecutePreCommand>
       <ExecuteCommandType>CS</ExecuteCommandType>
       <SetupInstructions>
         <SetupInstruction xsi:type="CustomSetupInstruction">
           <Code>start /wait "" "{AHK}" "{startuppath}PA.ahk" "{file}" "{installpath}{category}\{appname:regexreplace: \(.*\):}"
    
    ::Creating and renaming a custom .ini to disable splash screen
    if exist "{installpath}{category}\{appname:regexreplace: \(.*\):}\*Portable.ini" exit
    
    for /f "tokens=*" %a in ('dir /b "{installpath}{category}\{appname:regexreplace: \(.*\):}\Other\Source\*Portable.ini"') do (
    set ini={installpath}{category}\{appname:regexreplace: \(.*\):}\Other\Source\%a
    set file=%a
    )
    For /f "tokens=*" %i in ('type "%ini%"') do if /I "%i" EQU "DisableSplashScreen=false" (echo DisableSplashScreen=true>>"{installpath}{category}\{appname:regexreplace: \(.*\):}\%file%") else (echo %i>>"{installpath}{category}\{appname:regexreplace: \(.*\):}\%file%")
    for /f "tokens=*" %a in ('dir /b "{installpath}{category}\{appname:regexreplace: \(.*\):}\*.exe"') do set exe=%~na
    if exist "{installpath}{category}\{appname:regexreplace: \(.*\):}\*Portable.ini" rename "{installpath}{category}\{appname:regexreplace: \(.*\):}\%file%" "%exe%.ini"
    ::Creating and renaming a custom .ini to disable splash screen</Code>
           <Type>Batch</Type>
         </SetupInstruction>
       </SetupInstructions>
       <Category><placeholder name="Category" options="{categories}" /></Category>
       <SourceType>FixedUrl</SourceType>
       <DeletePreviousFile>true</DeletePreviousFile>
       <Enabled>true</Enabled>
       <FileHippoId />
       <TargetPath>{downloadpath}{category}\</TargetPath>
       <FixedDownloadUrl>{download:urldecode}</FixedDownloadUrl>
       <Name><placeholder name="Name of application" variable="name" /></Name>
     </ApplicationJob>
    </Jobs>
    

  15. 
    TextWriter ins = new StreamWriter("instructions.txt");
    
    // write a line of text to the file
    ins.WriteLine(app.Install(null));
    
    // close the stream
    ins.Close();
    

     

    Not a coder so if the above seems ridiculous my apologies. Above is what I attempted in C# but don't know anything about C#

     

    I am attempting to essentially apply the following logic to all my programs.

     

    There is no "install separately" feature in ketarin, only 'exclusive download'. I only require it as there are some things I use Ketarin for that have dependancies or AHK installs.

     

    I am trying to attempt that if there is an update available then

     

    if "{property:ExclusiveDownload}" EQU "True" echo "{property:SetupInstructions}">"{appname}".bat

     

    Obvious problem being that "{property:SetupInstructions}" doesn't exist

     

    Basically I get to download everything happily and then in the 'after all downloads complete' I would just put in

     

    call all batch files in exclusive downloads folder

    after they are all complete then delete the folder/batch files

     

    Any tips?

  16. Would it be possible to implement an error variable to output the exact error to a logfile? If it is a 403/404 or whatever.

     

    {apperror} or something along those lines so it is 'per app'.

     

    I'm using it more for the following

     

    set a={apperror}

    if defined a echo %a%>>error.txt

    if not exist error.txt taskkill /f /im ketarin.exe

     

    Also can we have the log screen be clearable?

    The setup instruction window is always 'on top' when I am trying to look at the log for the setup instructions so if we could make it so that the log window can be viewed that would be nice.

  17. Whilst a very 'minimal' torrent client being included in Ketarin might be a nice thing I still find it a waste of a feature.

     

    From the page provided you can still scrape the version and subsequent torrent file and using exit 1/exit 2 commands in Ketarin's scripting you can effectively achieve the same thing by piping the .torrent file ketarin downloads to your existing torrent client.

     

    If you use torrents at all you would already have a client.

  18. This is a feature that was requested quite some time ago, floele will get around to it when he has time i'm fairly sure.

     

    As it stands though you can just script around the issue. I know it is a big inelegant but hey, scripts are fun.

     

    I mean like for your first app

     

    echo wee>1.txt

    install code here

    del 1.txt

     

    and for the 'next' app that depends on the first app go

     

    :loop

    if exist 1.txt goto :loop

     

     

    The ketarin engine shell doesn't allow for loops n' stuff but if you just use the ketarin to call an external batch install it will work. Just a way to get you what you want until that feature is implemented.

  19. I did consider doing that a while ago however it is hard to automatically detect if the executable will run via being uniextracted so people would still prefer to pick/choose/figure out for themselves what is the best install method for their program. A zip can contain a standalone executable or an extractable msi file which may have to be installed anyway. Plus not everyone wants a portable installation of a program like me.

     

    I'm sure though I could patch a script up to account for 90% of situations however if you make things too automated I find people tend to become too complacent. As for a GUID 'tis done even though i've never gotten the prototype templates to work for me ever, no idea why

  20. I've tried to make a fairly easy to use/universal template for the souceforge site with some custom install commands that you can decomment (that just means delete the :: from the 2nd line in the scripts onwards) in order to use them.

    You can use any sourceforge URL project page, this will automatically find the latest file. You can just use the 'download latest' button however I prefer to download binaries/zipped/portable versions which aren't the ones that are hosted in the 'latest' button.

    Accurately defines the version variable/name and everything so tuck in.

    Global variables that are used in this (that I think everyone should use anyway but whatever) are:

    installpath = {root}Programs\
    temppath = {root}Ketatemp\
    7z = start "" /wait {root}"Programs\File Management\7-ZipPortable\App\7-Zip\7z.exe"
    ue = start "" /wait {root}"Programs\File Management\Universal Extractor\UniExtract.exe"
    copyfolder = xcopy /E /C /I /Q /H /Y
    downloadpath = {root}Software\Ketarin Maintained Applications\
    copyfile = xcopy /C /I /Q /H /Y

    sfua = (!)

    Just add the above values to your global variables and you will be set. Of course for the 7z/ue you need to change the path to your actual 7zip/uniextract exe file. However the only global variable you really need in order for the template to download anything is the sfua. Just an acronym for SourceForgeUserAgent.

    <!--?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="806226d4-a355-4ff8-81d3-5f0956cc1658">
    <WebsiteUrl>{url}</WebsiteUrl>
    <UserNotes />
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Default</DownloadBeta>
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator>version</VariableChangeIndicator>
    <CanBeShared>true</CanBeShared>
    <ShareApplication>false</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <UserAgent>{sfua}</UserAgent>
    <HttpReferer />
    <Variables>
    <item>
    <key>
    <string>download</string>
    </key>
    <value>
    <UrlVariable>
    <RegexRightToLeft>false</RegexRightToLeft>
    <VariableType>RegularExpression</VariableType>
    <Regex>[^"'<>\*]+files[^"'<>\*]+\.(?>zip|7z|rar|exe|msi)</Regex>
    <Url>http://sourceforge.net{refer2}</Url>
    <Name>download</Name>
    </UrlVariable>
    </value>
    </item>
    <item>
    <key>
    <string>installtype</string>
    </key>
    <value>
    <UrlVariable>
    <RegexRightToLeft>false</RegexRightToLeft>
    <VariableType>Textual</VariableType>
    <Regex />
    <TextualContent><placeholder name="Installation type" value="" options="No Install|Binary Unzip|Manual Install|Standalone EXE|Uniextract Executable" /></TextualContent>
    <Name>installtype</Name>
    </UrlVariable>
    </value>
    </item>
    <item>
    <key>
    <string>name</string>
    </key>
    <value>
    <UrlVariable>
    <RegexRightToLeft>false</RegexRightToLeft>
    <VariableType>RegularExpression</VariableType>
    <Regex><title>(.*?)[\s-]+</Regex>
    <Url>http://sourceforge.net{page}</Url>
    <Name>name</Name>
    </UrlVariable>
    </value>
    </item>
    <item>
    <key>
    <string>page</string>
    </key>
    <value>
    <UrlVariable>
    <RegexRightToLeft>false</RegexRightToLeft>
    <VariableType>RegularExpression</VariableType>
    <Regex>[^"';=]+files[^"';=]+</Regex>
    <Url>{url}</Url>
    <Name>page</Name>
    </UrlVariable>
    </value>
    </item>
    <item>
    <key>
    <string>refer1</string>
    </key>
    <value>
    <UrlVariable>
    <RegexRightToLeft>false</RegexRightToLeft>
    <VariableType>RegularExpression</VariableType>
    <Regex>folder.*?([^"']+files[^"']+)</Regex>
    <Url>http://sourceforge.net{page}</Url>
    <Name>refer1</Name>
    </UrlVariable>
    </value>
    </item>
    <item>
    <key>
    <string>refer2</string>
    </key>
    <value>
    <UrlVariable>
    <RegexRightToLeft>false</RegexRightToLeft>
    <VariableType>RegularExpression</VariableType>
    <Regex>folder.*?([^"']+files[^"']+)</Regex>
    <Url>http://sourceforge.net{refer1}</Url>
    <Name>refer2</Name>
    </UrlVariable>
    </value>
    </item>
    <item>
    <key>
    <string>url</string>
    </key>
    <value>
    <UrlVariable>
    <RegexRightToLeft>false</RegexRightToLeft>
    <VariableType>RegularExpression</VariableType>
    <Regex>[^"']+projects/.*?./</Regex>
    <Url><placeholder name="Application URL" /></Url>
    <Name>url</Name>
    </UrlVariable>
    </value>
    </item>
    <item>
    <key>
    <string>version</string>
    </key>
    <value>
    <UrlVariable>
    <RegexRightToLeft>false</RegexRightToLeft>
    <VariableType>RegularExpression</VariableType>
    <Regex>[^"'<>\*]+files[^"'<>\*]+\.(?>zip|7z|rar|exe|msi).*?(\d\d\d\d[\d\-\: ]+)</Regex>
    <Url>http://sourceforge.net{refer2}</Url>
    <Name>version</Name>
    </UrlVariable>
    </value>
    </item>
    </Variables>
    <ExecuteCommand>/*This is a comment line, the line below is the C# script. It will run the instructions found in the Setup Tab. If the command below is encapsulated with stars and slashes merely remove them to make the command function, otherwise it will remain a comment*/
    app.Install(null);</ExecuteCommand>
    <ExecutePreCommand />
    <ExecuteCommandType>CS</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <SetupInstructions>
    <SetupInstruction xsi:type="CustomSetupInstruction">
    <Code>::Use this if the file you are downloading is a binary that can be unzipped and run
    
    if "{installtype}" neq "Binary Unzip" exit
    
    ::Check to see if program is running and offer to kill it
    for /f "tokens=1 delims=." %b in ('wmic process get Description^,ExecutablePath^,CommandLine ^| findstr /v cmd.exe ^| findstr /v explorer.exe ^| findstr /v findstr ^| findstr "{installpath}{category}\{appname:regexreplace: \(.*\):}"') do set progkill=%~nxb & set prog=%b & set restart=yes
    if defined progkill start /wait cmd.exe /c "Echo {appname} is currently running and has to be terminated before updating, press any key to terminate the program & PAUSE & taskkill /f /im %progkill%.exe"
    ::/Check to see if program is running and offer to kill it
    
    {7z} x "{file}" -o"{temppath}{appname:regexreplace: \(.*\):}" -y
    for /f "tokens=2 delims=[]" %a in ('dir /b /s "{temppath}{appname:regexreplace: \(.*\):}\*.exe" ^| find /v /n "" ^| findstr /c:[1]') do set dir=%~dpa*
    {copyfolder} "%dir%" "{installpath}{category}\{appname:regexreplace: \(.*\):}\"
    rd /s /q "{temppath}{appname:regexreplace: \(.*\):}"
    
    ::Update finished, starting program
    if defined restart start cmd.exe /c "%prog%.exe""
    ::/Update finished, starting program</Code>
    <Type>Batch</Type>
    </SetupInstruction>
    <SetupInstruction xsi:type="CustomSetupInstruction">
    <Code>::Use this if the file you are downloading is an executable that can be UniExtracted and run
    
    if "{installtype}" neq "Uniextract Executable" exit
    
    ::Check to see if program is running and offer to kill it
    for /f "tokens=1 delims=." %b in ('wmic process get Description^,ExecutablePath^,CommandLine ^| findstr /v cmd.exe ^| findstr /v explorer.exe ^| findstr /v findstr ^| findstr "{installpath}{category}\{appname:regexreplace: \(.*\):}"') do set progkill=%~nxb & set prog=%b & set restart=yes
    if defined progkill start /wait cmd.exe /c "Echo {appname} is currently running and has to be terminated before updating, press any key to terminate the program & PAUSE & taskkill /f /im %progkill%.exe"
    ::/Check to see if program is running and offer to kill it
    
    {ue} "{file}" "{temppath}{appname:regexreplace: \(.*\):}"
    for /f "tokens=2 delims=[]" %a in ('dir /b /s "{temppath}{appname:regexreplace: \(.*\):}\*.exe" ^| find /v /n "" ^| findstr /c:[1]') do set dir=%~dpa*
    {copyfolder} "%dir%" "{installpath}{category}\{appname:regexreplace: \(.*\):}\"
    rd /s /q "{temppath}{appname:regexreplace: \(.*\):}"
    
    ::Update finished, starting program
    if defined restart start cmd.exe /c "%prog%.exe""
    ::/Update finished, starting program</Code>
    <Type>Batch</Type>
    </SetupInstruction>
    <SetupInstruction xsi:type="CustomSetupInstruction">
    <Code>::Use this if your file cannot be installed automatically and needs to be run manually after Ketarin finishes
    
    if "{installtype}" neq "Manual Install" exit
    
    
    ::Check to see if program is running and offer to kill it
    for /f "tokens=1 delims=." %b in ('wmic process get Description^,ExecutablePath^,CommandLine ^| findstr /v cmd.exe ^| findstr /v explorer.exe ^| findstr /v findstr ^| findstr "{installpath}{category}\{appname:regexreplace: \(.*\):}"') do set progkill=%~nxb & set prog=%b & set restart=yes
    if defined progkill start /wait cmd.exe /c "Echo {appname} is currently running and has to be terminated before updating, press any key to terminate the program & PAUSE & taskkill /f /im %progkill%.exe"
    ::/Check to see if program is running and offer to kill it
    
    START CMD /C "ECHO Re: {appname} You will have to run this file manually after Ketarin finishes updating && PAUSE"
    &
    
    ::Update finished, starting program
    if defined restart start cmd.exe /c "%prog%.exe""
    ::/Update finished, starting program</Code>
    <Type>Batch</Type>
    </SetupInstruction>
    <SetupInstruction xsi:type="CustomSetupInstruction">
    <Code>::Use this if your download is a standalone executable which just needs to be copied to the right place
    
    if "{installtype}" neq "Standalone EXE" exit
    
    ::Check to see if program is running and offer to kill it
    for /f "tokens=1 delims=." %b in ('wmic process get Description^,ExecutablePath^,CommandLine ^| findstr /v cmd.exe ^| findstr /v explorer.exe ^| findstr /v findstr ^| findstr "{installpath}{category}\{appname:regexreplace: \(.*\):}"') do set progkill=%~nxb & set prog=%b & set restart=yes
    if defined progkill start /wait cmd.exe /c "Echo {appname} is currently running and has to be terminated before updating, press any key to terminate the program & PAUSE & taskkill /f /im %progkill%.exe"
    ::/Check to see if program is running and offer to kill it
    
    {copyfile} "{file}" "{installpath}{category}\{appname:regexreplace: \(.*\):}\"
    
    ::Update finished, starting program
    if defined restart start cmd.exe /c "%prog%.exe""
    ::/Update finished, starting program</Code>
    <Type>Batch</Type>
    </SetupInstruction>
    </SetupInstructions>
    <Category><placeholder name="Category" options="{categories}" /></Category>
    <SourceType>FixedUrl</SourceType>
    <DeletePreviousFile>true</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <TargetPath>{downloadpath}{category}\</TargetPath>
    <FixedDownloadUrl>{download}</FixedDownloadUrl>
    <Name><placeholder name="Name of application" variable="name" /></Name>
    </ApplicationJob>
    </Jobs>

    EDIT: Made the option choice for user to select the type of install. I would recommend however knowing the installation method for the file you are downloading from sourceforge beforehand before blindly selecting what install type. The default option is "No Install" meaning it will just download and not execute any of my custom install options.

    EDIT: Tweaked the 'version' variable as sourceforge does stuff like "Updated 1 hour ago" and so on. Changed it to the time stamp of the file you are actually downloading. Some regex tweaks (Atomic Grouping specifically). Also implemented my new 'kill program if running' dialog. It basically looks into your default install path and checks if any executables are running from that path before giving the option to terminate it.
×
×
  • 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.