Jump to content
Ketarin forum

Command after download versus Setup


rainroom
 Share

Recommended Posts

Dears,

exploring and using Ketarin more and more I want to go further in automation after my first round of downloads.

However what is not really clear to me is when to use setup commands and/or when to use commands after download ?

Let me try to explain.  I have Ditto.exe running and what I would like to achieve is a download of a new version, extract the zip and install as well copy over the existing settings file which is located in another folder and copy this over the setting file from the just extracted zip so I can get my own settings again.

Today I have in the setup section 3 commands.  

1) {NirCmd} killprocess Ditto.exe   << where {NirCmd} as a globel var. has "U:\Portable Files\nircmd.exe"

2) 7Z.exe  x "{file}" -o"C:\Portable Files\" -y   <<  this is going well

3) "c:\portable files\Ditto\ditto.exe"  << to start Ditto again after extract

The issue is that the kill process does not work.  Ditto is not closed.  this is I guess resulting in an error when using the install option from Ketarin.

In the commands after download I have the following:

xcopy U:\CentralFiles\ditto.settings "c:\portable files\Ditto\"
xcopy U:\CentralFiles\mycopy.xml "c:\portable files\Ditto\Themes\"

 

Any help on doing this better is appreciated as will with a explanation when to use the setup and when the commands after download or even when to use both the same time....


 

Quote

 

<?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="e25ac9a1-20cc-422a-83a8-44f044c9e658">
    <Category>Utilities</Category>
    <WebsiteUrl>http://ditto-cp.sourceforge.net/beta/</WebsiteUrl>
    <UserAgent />
    <UserNotes>RD /S /Q "c:\portable files\Ditto"</UserNotes>
    <LastFileSize>15959318</LastFileSize>
    <LastFileDate>2017-06-19T15:31:53+02:00</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>true</ShareApplication>
    <ExclusiveDownload>true</ExclusiveDownload>
    <HttpReferer />
    <SetupInstructions>
      <SetupInstruction xsi:type="CustomSetupInstruction">
        <Code>{NirCmd} killprocess Ditto.exe</Code>
        <Type>Batch</Type>
      </SetupInstruction>
      <SetupInstruction xsi:type="StartProcessInstruction">
        <EnvironmentVariables />
        <FileName>7Z.exe </FileName>
        <Parameters>x "{file}" -o"C:\Portable Files\" -y</Parameters>
        <WaitForExit>true</WaitForExit>
      </SetupInstruction>
      <SetupInstruction xsi:type="StartProcessInstruction">
        <EnvironmentVariables />
        <FileName>"c:\portable files\Ditto\ditto.exe"</FileName>
        <Parameters />
        <WaitForExit>false</WaitForExit>
      </SetupInstruction>
    </SetupInstructions>
    <Variables>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>StartEnd</VariableType>
            <Regex />
            <Url>http://ditto-cp.sourceforge.net/beta/</Url>
            <StartText>&lt;b&gt;Ditto beta, version </StartText>
            <EndText>.0&lt;/b&gt;
&lt;br&gt;&lt;br&gt;
</EndText>
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>setup</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>Yes (c:)+AD</TextualContent>
            <Name>setup</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>versionurl</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>StartEnd</VariableType>
            <Regex />
            <Url>http://ditto-cp.sourceforge.net/beta/</Url>
            <StartText>&lt;a href="DittoPortable_</StartText>
            <EndText>.zip"&gt;Ditto Portable&lt;/a&gt;&lt;br&gt;
</EndText>
            <Name>versionurl</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand>xcopy U:\CentralFiles\ditto.settings "c:\portable files\Ditto\"
xcopy U:\CentralFiles\rainroom69_v2.xml "c:\portable files\Ditto\Themes\"</ExecuteCommand>
    <ExecutePreCommand />
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <SourceType>FixedUrl</SourceType>
    <PreviousLocation>U:\Computer-Repair\Portable\Utilities\Ditto Beta_v3.21.175.zip</PreviousLocation>
    <DeletePreviousFile>false</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <LastUpdated>2017-06-19T19:07:10.5263183+02:00</LastUpdated>
    <TargetPath>{root}Computer-Repair\Portable\{category}\{appname:regexreplace: \(.*\):}_v{version}.{url:ext}</TargetPath>
    <FixedDownloadUrl>http://ditto-cp.sourceforge.net/beta/DittoPortable_64bit_{versionurl}.zip</FixedDownloadUrl>
    <Name>Ditto Beta (Portable)</Name>
  </ApplicationJob>
</Jobs> 


 

 

Link to comment
Share on other sites

the real difference is context. "post-update" is still within the download/update process, so it's best used for things like purging archival copies, fluff information or passing off the download for secondary processing (such as torrents to aria2). you can still use flags at this point to indicate whether it's succeeded or failed.

i think the error you're seeing is really more about the process termination. i'm not familiar with the application you're using, but i've had great success with pskill:

pskill -t Ditto.exe

This kills all processes that match that name *and* all child threads. It also doesn't "return" to continue processing until it either succeeds or fails. i suspect that the other one may continue processing before completely killing the process, which means the next step won't work (copying over the new file).

The first time you run it you'll need to "allow" it and accept the license agreement, which stores a registry flag so you won't be prompted again in the future.

 

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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