Jump to content
Ketarin forum
Sign in to follow this  
Omniferum

Batch variable issue?

Recommended Posts

I'm not 100% sure if this is a bug or not, but it seemed the most likely place to post.

 

The code i'm posting does essentially find the first executable file, set the directory that it is in as the variable dir. This helps for zips that get extracted to one or more subfolders. Also a little bit extra code for not overwriting existing ini files.

 

Trouble is the code works fine in batch/cmd line. However putting it in Ketarin it doesn't expand %dir% in this instance. If I do echo %dir% will echo the variable expanded however using it in a command it doesn't seem to expand. I've spent a while on this and i'm not sure why it does this.

 

{7z} x "{file}" -o"{p2}{appname:regexreplace: \(.*\):}" -y
dir /b /s "{p2}{appname:regexreplace: \(.*\):}"\*.exe > "{p2}{appname:regexreplace: \(.*\):}"\1.txt
set /p f=<"{p2}{appname:regexreplace: \(.*\):}"\1.txt
echo %f% > "{p2}{appname:regexreplace: \(.*\):}"\2.txt
for /f "tokens=*" %a in ("{p2}{appname:regexreplace: \(.*\):}"\2.txt) do set dir=%~dpa
{copy} "%dir%" "{p1}{category}\{appname:regexreplace: \(.*\):}\"
rd /s /q "{p2}{appname:regexreplace: \(.*\):}"

 

this is the resulting log output

 

04/12/2010 5:24:57 AM: MPlayer WW: Executing command: start /wait D:\"Programs\File Management\7-ZipPortable\App\7-Zip\7z.exe" x "D:\Software\Programs\Video\mplayer-SVN-r32669.7z" -o"D:\Ketatemp\MPlayer WW" -y
04/12/2010 5:24:57 AM: MPlayer WW: Executing command: dir /b /s "D:\Ketatemp\MPlayer WW"\*.exe > 1.txt
04/12/2010 5:24:57 AM: MPlayer WW: Executing command: set /p f=<1.txt
04/12/2010 5:24:57 AM: MPlayer WW: Executing command: echo %f% > 2.txt
04/12/2010 5:24:57 AM: MPlayer WW: Executing command: for /f "tokens=*" %a in (2.txt) do set path=%~dpa
04/12/2010 5:24:57 AM: MPlayer WW: Executing command: if exist "D:\Programs\Video\MPlayer WW"\mplayer.ini del "%path%"\mplayer.ini
04/12/2010 5:24:57 AM: MPlayer WW: Executing command: if exist "D:\Programs\Video\MPlayer WW"\kk.ini del "%path%"\kk.ini
04/12/2010 5:24:57 AM: MPlayer WW: Executing command: if exist "D:\Programs\Video\MPlayer WW"\input.ini del "%path%"\input.ini
04/12/2010 5:24:57 AM: MPlayer WW: Executing command: xcopy /C /E /H /I /Y "%path%" "D:\Programs\Video\MPlayer WW\"
04/12/2010 5:24:57 AM: MPlayer WW: Executing command: rd /s /q "D:\Ketatemp\MPlayer WW"
04/12/2010 5:24:58 AM: MPlayer WW: Command result: Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
D:\Programs\Internet\Ketarin>start /wait D:\"Programs\File Management\7-ZipPortable\App\7-Zip\7z.exe" x "D:\Software\Programs\Video\mplayer-SVN-r32669.7z" -o"D:\Ketatemp\MPlayer WW" -y
D:\Programs\Internet\Ketarin>dir /b /s "D:\Ketatemp\MPlayer WW"\*.exe > 1.txt
D:\Programs\Internet\Ketarin>set /p f=<1.txt
D:\Programs\Internet\Ketarin>echo %f% > 2.txt
D:\Programs\Internet\Ketarin>for /f "tokens=*" %a in (2.txt) do set path=%~dpa
D:\Programs\Internet\Ketarin>set path=D:\Ketatemp\MPlayer WW\mplayer_release\mplayer\ 
D:\Programs\Internet\Ketarin>if exist "D:\Programs\Video\MPlayer WW"\mplayer.ini del "%path%"\mplayer.ini
D:\Programs\Internet\Ketarin>if exist "D:\Programs\Video\MPlayer WW"\kk.ini del "%path%"\kk.ini
D:\Programs\Internet\Ketarin>if exist "D:\Programs\Video\MPlayer WW"\input.ini del "%path%"\input.ini
D:\Programs\Internet\Ketarin>xcopy /C /E /H /I /Y "%path%" "D:\Programs\Video\MPlayer WW\"
'xcopy' is not recognized as an internal or external command,
operable program or batch file.
D:\Programs\Internet\Ketarin>rd /s /q "D:\Ketatemp\MPlayer WW"
D:\Programs\Internet\Ketarin>

 

I've deleted the app and made it fresh/new, but still the same problem. If someone else has a ketarin install that they may like to try this out on i'd appreciate it.

 

here is the xml for my app

 

<?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="c78ede13-9565-40a4-94d2-a875886e8aa0">
   <SourceTemplate><![CDATA[<?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 />
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <ExclusiveDownload>false</ExclusiveDownload>
   <UserAgent>{sfua}</UserAgent>
   <HttpReferer></HttpReferer>
   <Variables>
     <item>
       <key>
         <string>download</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>(http[^"']+[^"']+(\.zip|\.rar|\.7z))</Regex>
           <Url>http://sourceforge.net{folder2}</Url>
           <Name>download</Name>
         </UrlVariable>
       </value>
     </item>
           <item>
       <key>
         <string>folder1</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>["']([^"']+projects[^"']+files[^"']+)/"</Regex>
           <Url><placeholder name="Application Page URL" value="http://sourceforge.net/projects/mplayer-ww/files/" /></Url>
           <Name>folder1</Name>
         </UrlVariable>
       </value>
     </item>
           <item>
       <key>
         <string>folder2</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>["']([^"']+projects[^"']+files[^"']+)/"</Regex>
           <Url>http://sourceforge.net{folder1}</Url>
           <Name>folder2</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>name</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>title="/(.*?)/</Regex>
           <Url><placeholder name="Application Page URL" value="http://sourceforge.net/projects/mplayer-ww/files/" /></Url>
           <Name>name</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*/
app.Install(null);</ExecuteCommand>
   <ExecutePreCommand />
   <ExecuteCommandType>CS</ExecuteCommandType>
   <ExecutePreCommandType>Batch</ExecutePreCommandType>
   <SetupInstructions />
   <Category><placeholder name="Category" value="Video" /></Category>
   <SourceType>FixedUrl</SourceType>
   <DeletePreviousFile>true</DeletePreviousFile>
   <Enabled>true</Enabled>
   <FileHippoId />
   <TargetPath>{s1}{category}\</TargetPath>
   <FixedDownloadUrl>{download}</FixedDownloadUrl>
   <Name><placeholder name="Name of application" variable="name" value="MPlayer_Release" /></Name>
 </ApplicationJob>
</Jobs>]]></SourceTemplate>
   <WebsiteUrl />
   <UserAgent>{sfua}</UserAgent>
   <UserNotes />
   <LastFileSize>8556426</LastFileSize>
   <LastFileDate>2010-12-04T02:38:59.3821005</LastFileDate>
   <IgnoreFileInformation>false</IgnoreFileInformation>
   <DownloadBeta>Default</DownloadBeta>
   <DownloadDate xsi:nil="true" />
   <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
   <VariableChangeIndicator />
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <ExclusiveDownload>false</ExclusiveDownload>
   <HttpReferer />
   <SetupInstructions>
     <SetupInstruction xsi:type="CustomSetupInstruction">
       <Code>{7z} x "{file}" -o"{p2}{appname:regexreplace: \(.*\):}" -y
dir /b /s "{p2}{appname:regexreplace: \(.*\):}"\*.exe > 1.txt
set /p f=<1.txt
echo %f% > 2.txt
for /f "tokens=*" %a in (2.txt) do set path=%~dpa
if exist "{p1}{category}\{appname:regexreplace: \(.*\):}"\mplayer.ini del "%path%"\mplayer.ini
if exist "{p1}{category}\{appname:regexreplace: \(.*\):}"\kk.ini del "%path%"\kk.ini
if exist "{p1}{category}\{appname:regexreplace: \(.*\):}"\input.ini del "%path%"\input.ini
{copy} "%path%" "{p1}{category}\{appname:regexreplace: \(.*\):}\"
rd /s /q "{p2}{appname:regexreplace: \(.*\):}"</Code>
       <Type>Batch</Type>
     </SetupInstruction>
   </SetupInstructions>
   <Variables>
     <item>
       <key>
         <string>download</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>class="status.*?(http[^"']+[^"']+(\.zip|\.rar|\.7z))</Regex>
           <Url>http://sourceforge.net{folder1}</Url>
           <Name>download</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>folder1</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>["']([^"']+projects[^"']+files[^"']+)/"</Regex>
           <Url>http://sourceforge.net/projects/mplayer-ww/files/</Url>
           <Name>folder1</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>folder2</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>["']([^"']+projects[^"']+files[^"']+)/"</Regex>
           <Url>http://sourceforge.net{folder1}</Url>
           <Name>folder2</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>name</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>title="/(.*?)/</Regex>
           <Url>http://sourceforge.net/projects/mplayer-ww/files/</Url>
           <Name>name</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*/
app.Install(null);</ExecuteCommand>
   <ExecutePreCommand />
   <ExecuteCommandType>CS</ExecuteCommandType>
   <ExecutePreCommandType>Batch</ExecutePreCommandType>
   <Category>Video</Category>
   <SourceType>FixedUrl</SourceType>
   <PreviousLocation>D:\Software\Programs\Video\mplayer-SVN-r32669.7z</PreviousLocation>
   <DeletePreviousFile>true</DeletePreviousFile>
   <Enabled>true</Enabled>
   <FileHippoId />
   <LastUpdated>2010-12-04T02:38:59.3821005</LastUpdated>
   <TargetPath>{s1}{category}\</TargetPath>
   <FixedDownloadUrl>{download}</FixedDownloadUrl>
   <Name>MPlayer WW</Name>
 </ApplicationJob>
</Jobs>

Share this post


Link to post
Share on other sites

"path" is a reserved variable. Try it again using a different custom variable name and you will have better luck. Since you're overwriting it, you're preventing Windows from knowing where to find xcopy and other applications that it's trying to access.

Share this post


Link to post
Share on other sites

Mid-posting I tested something different is all, posted the changes.

 

I even tried setting the variable as %qwe% but still same problem. I also get this error

 

D:\Programs\Internet\Ketarin>xcopy /C /E /H /I /Y "%path%" "D:\Programs\Video\MPlayer WW\"

'xcopy' is not recognized as an internal or external command,

operable program or batch file.

 

and again it is only for this specific app that i'm having the trouble, all the other with such commands are perfectly fine.

 

For example here is my notepad++

 

Batch code

{7z} x "{file}" -o"{p2}{appname:regexreplace: \(.*\):}" -y
for /F "tokens=*" %d in ('dir "{p2}{appname:regexreplace: \(.*\):}" /ad /b') do set dir="{p2}{appname:regexreplace: \(.*\):}"\%d
if exist "{p1}{category}\{appname:regexreplace: \(.*\):}"\config.xml del "%dir%"\config.xml
{copy} "%dir%" "{p1}{category}\{appname:regexreplace: \(.*\):}"
rd /s /q "{p2}{appname:regexreplace: \(.*\):}"

 

Log

04/12/2010 7:46:58 PM: Notepad++ (Unicode Binary): Executing command: start /wait D:\"Programs\File Management\7-ZipPortable\App\7-Zip\7z.exe" x "D:\Software\Programs\Productivity\npp.5.8.5.bin.7z" -o"D:\Ketatemp\Notepad++" -y
04/12/2010 7:46:58 PM: Notepad++ (Unicode Binary): Executing command: for /F "tokens=*" %d in ('dir "D:\Ketatemp\Notepad++" /ad /b') do set dir="D:\Ketatemp\Notepad++"\%d
04/12/2010 7:46:58 PM: Notepad++ (Unicode Binary): Executing command: if exist "D:\Programs\Productivity\Notepad++"\config.xml del "%dir%"\config.xml
04/12/2010 7:46:58 PM: Notepad++ (Unicode Binary): Executing command: xcopy /C /E /H /I /Y "%dir%" "D:\Programs\Productivity\Notepad++"
04/12/2010 7:46:58 PM: Notepad++ (Unicode Binary): Executing command: rd /s /q "D:\Ketatemp\Notepad++"
04/12/2010 7:46:59 PM: Notepad++ (Unicode Binary): Command result: Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
D:\Programs\Internet\Ketarin>start /wait D:\"Programs\File Management\7-ZipPortable\App\7-Zip\7z.exe" x "D:\Software\Programs\Productivity\npp.5.8.5.bin.7z" -o"D:\Ketatemp\Notepad++" -y
D:\Programs\Internet\Ketarin>for /F "tokens=*" %d in ('dir "D:\Ketatemp\Notepad++" /ad /b') do set dir="D:\Ketatemp\Notepad++"\%d
D:\Programs\Internet\Ketarin>set dir="D:\Ketatemp\Notepad++"\ansi 
D:\Programs\Internet\Ketarin>set dir="D:\Ketatemp\Notepad++"\unicode 
D:\Programs\Internet\Ketarin>if exist "D:\Programs\Productivity\Notepad++"\config.xml del "%dir%"\config.xml
Could Not Find D:\Ketatemp\Notepad++\unicode\config.xml
D:\Programs\Internet\Ketarin>xcopy /C /E /H /I /Y "%dir%" "D:\Programs\Productivity\Notepad++"
D:\Ketatemp\Notepad++\unicode\change.log
D:\Ketatemp\Notepad++\unicode\config.model.xml
D:\Ketatemp\Notepad++\unicode\contextMenu.xml
D:\Ketatemp\Notepad++\unicode\doLocalConf.xml
D:\Ketatemp\Notepad++\unicode\langs.model.xml
D:\Ketatemp\Notepad++\unicode\license.txt
D:\Ketatemp\Notepad++\unicode\notepad++.exe
D:\Ketatemp\Notepad++\unicode\NppHelp.chm
D:\Ketatemp\Notepad++\unicode\readme.txt
D:\Ketatemp\Notepad++\unicode\SciLexer.dll
D:\Ketatemp\Notepad++\unicode\shortcuts.xml
D:\Ketatemp\Notepad++\unicode\stylers.model.xml
D:\Ketatemp\Notepad++\unicode\localization\afrikaans.xml
D:\Ketatemp\Notepad++\unicode\localization\albanian.xml
D:\Ketatemp\Notepad++\unicode\localization\arabic.xml
D:\Ketatemp\Notepad++\unicode\localization\aranese.xml
D:\Ketatemp\Notepad++\unicode\localization\azerbaijani.xml
D:\Ketatemp\Notepad++\unicode\localization\basque.xml
D:\Ketatemp\Notepad++\unicode\localization\belarusian.xml
D:\Ketatemp\Notepad++\unicode\localization\bosnian.xml
D:\Ketatemp\Notepad++\unicode\localization\brazilian_portuguese.xml
D:\Ketatemp\Notepad++\unicode\localization\bulgarian.xml
D:\Ketatemp\Notepad++\unicode\localization\catalan.xml
D:\Ketatemp\Notepad++\unicode\localization\chinese.xml
D:\Ketatemp\Notepad++\unicode\localization\chineseSimplified.xml
D:\Ketatemp\Notepad++\unicode\localization\croatian.xml
D:\Ketatemp\Notepad++\unicode\localization\czech.xml
D:\Ketatemp\Notepad++\unicode\localization\danish.xml
D:\Ketatemp\Notepad++\unicode\localization\dutch.xml
D:\Ketatemp\Notepad++\unicode\localization\english.xml
D:\Ketatemp\Notepad++\unicode\localization\extremaduran.xml
D:\Ketatemp\Notepad++\unicode\localization\farsi.xml
D:\Ketatemp\Notepad++\unicode\localization\finnish.xml
D:\Ketatemp\Notepad++\unicode\localization\french.xml
D:\Ketatemp\Notepad++\unicode\localization\friulian.xml
D:\Ketatemp\Notepad++\unicode\localization\galician.xml
D:\Ketatemp\Notepad++\unicode\localization\georgian.xml
D:\Ketatemp\Notepad++\unicode\localization\german.xml
D:\Ketatemp\Notepad++\unicode\localization\greek.xml
D:\Ketatemp\Notepad++\unicode\localization\hebrew.xml
D:\Ketatemp\Notepad++\unicode\localization\hungarian.xml
D:\Ketatemp\Notepad++\unicode\localization\hungarianA.xml
D:\Ketatemp\Notepad++\unicode\localization\indonesian.xml
D:\Ketatemp\Notepad++\unicode\localization\italian.xml
D:\Ketatemp\Notepad++\unicode\localization\japanese.xml
D:\Ketatemp\Notepad++\unicode\localization\kazakh.xml
D:\Ketatemp\Notepad++\unicode\localization\korean.xml
D:\Ketatemp\Notepad++\unicode\localization\kyrgyz.xml
D:\Ketatemp\Notepad++\unicode\localization\Latvian.xml
D:\Ketatemp\Notepad++\unicode\localization\lithuanian.xml
D:\Ketatemp\Notepad++\unicode\localization\luxembourgish.xml
D:\Ketatemp\Notepad++\unicode\localization\macedonian.xml
D:\Ketatemp\Notepad++\unicode\localization\malay.xml
D:\Ketatemp\Notepad++\unicode\localization\norwegian.xml
D:\Ketatemp\Notepad++\unicode\localization\nynorsk.xml
D:\Ketatemp\Notepad++\unicode\localization\occitan.xml
D:\Ketatemp\Notepad++\unicode\localization\polish.xml
D:\Ketatemp\Notepad++\unicode\localization\portuguese.xml
D:\Ketatemp\Notepad++\unicode\localization\romanian.xml
D:\Ketatemp\Notepad++\unicode\localization\russian.xml
D:\Ketatemp\Notepad++\unicode\localization\samogitian.xml
D:\Ketatemp\Notepad++\unicode\localization\serbian.xml
D:\Ketatemp\Notepad++\unicode\localization\serbianCyrillic.xml
D:\Ketatemp\Notepad++\unicode\localization\slovak.xml
D:\Ketatemp\Notepad++\unicode\localization\slovakA.xml
D:\Ketatemp\Notepad++\unicode\localization\slovenian.xml
D:\Ketatemp\Notepad++\unicode\localization\spanish.xml
D:\Ketatemp\Notepad++\unicode\localization\spanish_ar.xml
D:\Ketatemp\Notepad++\unicode\localization\swedish.xml
D:\Ketatemp\Notepad++\unicode\localization\tagalog.xml
D:\Ketatemp\Notepad++\unicode\localization\tamil.xml
D:\Ketatemp\Notepad++\unicode\localization\thai.xml
D:\Ketatemp\Notepad++\unicode\localization\turkish.xml
D:\Ketatemp\Notepad++\unicode\localization\ukrainian.xml
D:\Ketatemp\Notepad++\unicode\localization\uzbek.xml
D:\Ketatemp\Notepad++\unicode\localization\uzbekCyrillic.xml
D:\Ketatemp\Notepad++\unicode\plugins\ComparePlugin.dll
D:\Ketatemp\Notepad++\unicode\plugins\NppExport.dll
D:\Ketatemp\Notepad++\unicode\plugins\NppFTP.dll
D:\Ketatemp\Notepad++\unicode\plugins\NppTextFX.dll
D:\Ketatemp\Notepad++\unicode\plugins\PluginManager.dll
D:\Ketatemp\Notepad++\unicode\plugins\SpellChecker.dll
D:\Ketatemp\Notepad++\unicode\plugins\APIs\actionscript.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\c.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\cmake.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\cpp.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\cs.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\css.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\html.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\java.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\javascript.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\lisp.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\nsis.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\perl.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\php.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\python.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\rc.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\sql.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\tex.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\vb.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\vhdl.xml
D:\Ketatemp\Notepad++\unicode\plugins\APIs\xml.xml
D:\Ketatemp\Notepad++\unicode\plugins\Config\tidy\AsciiToEBCDIC.bin
D:\Ketatemp\Notepad++\unicode\plugins\Config\tidy\HTMLTIDY.CFG
D:\Ketatemp\Notepad++\unicode\plugins\Config\tidy\HTMLTIDY.ERR
D:\Ketatemp\Notepad++\unicode\plugins\Config\tidy\libTidy.dll
D:\Ketatemp\Notepad++\unicode\plugins\Config\tidy\TIDYCFG.INI
D:\Ketatemp\Notepad++\unicode\plugins\Config\tidy\W3C-CSSValidator.htm
D:\Ketatemp\Notepad++\unicode\plugins\Config\tidy\W3C-HTMLValidator.htm
D:\Ketatemp\Notepad++\unicode\plugins\doc\NPPTextFXdemo.TXT
D:\Ketatemp\Notepad++\unicode\plugins\doc\NppFTP\license_libssh.txt
D:\Ketatemp\Notepad++\unicode\plugins\doc\NppFTP\license_NppFTP.txt
D:\Ketatemp\Notepad++\unicode\plugins\doc\NppFTP\license_OpenSSL.txt
D:\Ketatemp\Notepad++\unicode\plugins\doc\NppFTP\license_TiXML.txt
D:\Ketatemp\Notepad++\unicode\plugins\doc\NppFTP\license_UTCP.htm
D:\Ketatemp\Notepad++\unicode\plugins\doc\NppFTP\license_ZLIB.txt
D:\Ketatemp\Notepad++\unicode\plugins\doc\NppFTP\Readme.txt
D:\Ketatemp\Notepad++\unicode\plugins\doc\PythonScript\PythonScript.chm
D:\Ketatemp\Notepad++\unicode\plugins\doc\SelectNLaunch\license.txt
D:\Ketatemp\Notepad++\unicode\plugins\doc\SelectNLaunch\readme.txt
D:\Ketatemp\Notepad++\unicode\plugins\doc\ZenCodingPython\readme.txt
D:\Ketatemp\Notepad++\unicode\themes\Bespin.xml
D:\Ketatemp\Notepad++\unicode\themes\Black board.xml
D:\Ketatemp\Notepad++\unicode\themes\Choco.xml
D:\Ketatemp\Notepad++\unicode\themes\Deep Black.xml
D:\Ketatemp\Notepad++\unicode\themes\Hello Kitty.xml
D:\Ketatemp\Notepad++\unicode\themes\Mono Industrial.xml
D:\Ketatemp\Notepad++\unicode\themes\Monokai.xml
D:\Ketatemp\Notepad++\unicode\themes\Obsidian.xml
D:\Ketatemp\Notepad++\unicode\themes\Plastic Code Wrap.xml
D:\Ketatemp\Notepad++\unicode\themes\Ruby Blue.xml
D:\Ketatemp\Notepad++\unicode\themes\Twilight.xml
D:\Ketatemp\Notepad++\unicode\themes\Vibrant Ink.xml
D:\Ketatemp\Notepad++\unicode\themes\vim Dark Blue.xml
D:\Ketatemp\Notepad++\unicode\themes\Zenburn.xml
D:\Ketatemp\Notepad++\unicode\updater\gpup.exe
136 File(s) copied
D:\Programs\Internet\Ketarin>rd /s /q "D:\Ketatemp\Notepad++"
D:\Programs\Internet\Ketarin>

 

Full 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="4323957a-3273-49fb-aeb4-e69e3a590250">
   <SourceTemplate><![CDATA[<?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 />
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <ExclusiveDownload>false</ExclusiveDownload>
   <UserAgent>{sfua}</UserAgent>
   <HttpReferer></HttpReferer>
   <Variables>
     <item>
       <key>
         <string>download</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>(http[^"']+[^"']+(\.zip|\.rar|\.7z))</Regex>
           <Url>http://sourceforge.net{folder2}</Url>
           <Name>download</Name>
         </UrlVariable>
       </value>
     </item>
           <item>
       <key>
         <string>folder1</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>["']([^"']+projects[^"']+files[^"']+)/"</Regex>
           <Url><placeholder name="Application Page URL" value="http://sourceforge.net/projects/notepad-plus/files/" /></Url>
           <Name>folder1</Name>
         </UrlVariable>
       </value>
     </item>
           <item>
       <key>
         <string>folder2</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>["']([^"']+projects[^"']+files[^"']+)/"</Regex>
           <Url>http://sourceforge.net{folder1}</Url>
           <Name>folder2</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>name</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>title="/(.*?)/</Regex>
           <Url><placeholder name="Application Page URL" value="http://sourceforge.net/projects/notepad-plus/files/" /></Url>
           <Name>name</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*/
app.Install(null);</ExecuteCommand>
   <ExecutePreCommand />
   <ExecuteCommandType>CS</ExecuteCommandType>
   <ExecutePreCommandType>Batch</ExecutePreCommandType>
   <SetupInstructions />
   <Category><placeholder name="Category" value="Productivity" /></Category>
   <SourceType>FixedUrl</SourceType>
   <DeletePreviousFile>true</DeletePreviousFile>
   <Enabled>true</Enabled>
   <FileHippoId />
   <TargetPath>{s1}{category}\</TargetPath>
   <FixedDownloadUrl>{download}</FixedDownloadUrl>
   <Name><placeholder name="Name of application" variable="name" value="notepad++ releases binary" /></Name>
 </ApplicationJob>
</Jobs>]]></SourceTemplate>
   <WebsiteUrl />
   <UserAgent>{sfua}</UserAgent>
   <UserNotes />
   <LastFileSize>3425892</LastFileSize>
   <LastFileDate>2010-12-02T22:51:33.3122627</LastFileDate>
   <IgnoreFileInformation>false</IgnoreFileInformation>
   <DownloadBeta>Default</DownloadBeta>
   <DownloadDate xsi:nil="true" />
   <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
   <VariableChangeIndicator />
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <ExclusiveDownload>false</ExclusiveDownload>
   <HttpReferer />
   <SetupInstructions>
     <SetupInstruction xsi:type="CustomSetupInstruction">
       <Code>{7z} x "{file}" -o"{p2}{appname:regexreplace: \(.*\):}" -y
&
for /F "tokens=*" %d in ('dir "{p2}{appname:regexreplace: \(.*\):}" /ad /b') do set dir="{p2}{appname:regexreplace: \(.*\):}"\%d
&
if exist "{p1}{category}\{appname:regexreplace: \(.*\):}"\config.xml del "%dir%"\config.xml
&
{copy} "%dir%" "{p1}{category}\{appname:regexreplace: \(.*\):}"
&
rd /s /q "{p2}{appname:regexreplace: \(.*\):}"</Code>
       <Type>Batch</Type>
     </SetupInstruction>
   </SetupInstructions>
   <Variables>
     <item>
       <key>
         <string>download</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>(http[^"']+[^"']+\.bin(\.zip|\.rar|\.7z))</Regex>
           <Url>http://sourceforge.net{folder2}</Url>
           <Name>download</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>folder1</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>["']([^"']+projects[^"']+files[^"']+)/"</Regex>
           <Url>http://sourceforge.net/projects/notepad-plus/files/</Url>
           <Name>folder1</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>folder2</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>["']([^"']+projects[^"']+files[^"']+)/"</Regex>
           <Url>http://sourceforge.net{folder1}</Url>
           <Name>folder2</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>name</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>title="/(.*?)/</Regex>
           <Url>http://sourceforge.net/projects/notepad-plus/files/</Url>
           <Name>name</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*/
app.Install(null);</ExecuteCommand>
   <ExecutePreCommand />
   <ExecuteCommandType>CS</ExecuteCommandType>
   <ExecutePreCommandType>Batch</ExecutePreCommandType>
   <Category>Productivity</Category>
   <SourceType>FixedUrl</SourceType>
   <PreviousLocation>D:\Software\Programs\Productivity\npp.5.8.5.bin.7z</PreviousLocation>
   <DeletePreviousFile>true</DeletePreviousFile>
   <Enabled>true</Enabled>
   <FileHippoId />
   <LastUpdated>2010-12-02T22:51:33.3122627</LastUpdated>
   <TargetPath>{s1}{category}\</TargetPath>
   <FixedDownloadUrl>{download}</FixedDownloadUrl>
   <Name>Notepad++ (Unicode Binary)</Name>
 </ApplicationJob>
</Jobs>

Share this post


Link to post
Share on other sites

Solved my problem, i'm not sure why it needed to be done this way specifically but hey, anything that works is all ok.

 

{7z} x "{file}" -o"{temppath}{appname:regexreplace: \(.*\):}" -y
dir /b /s "{temppath}{appname:regexreplace: \(.*\):}"\*.exe > "{temppath}{appname:regexreplace: \(.*\):}"\1.txt
set /p f=<"{temppath}{appname:regexreplace: \(.*\):}"\1.txt
echo %f% > "{temppath}{appname:regexreplace: \(.*\):}"\2.txt
cd "{temppath}{appname:regexreplace: \(.*\):}"
for /f "tokens=*" %a in (2.txt) do set dir=%~dpa*
if exist "{installpath}{category}\{appname:regexreplace: \(.*\):}"\mplayer.ini del "%dir%"mplayer.ini
if exist "{installpath}{category}\{appname:regexreplace: \(.*\):}"\kk.ini del "%dir%"kk.ini
if exist "{installpath}{category}\{appname:regexreplace: \(.*\):}"\input.ini del "%dir%"input.ini
{copyfolder} "%dir%" "{installpath}{category}\{appname:regexreplace: \(.*\):}\"
rd /s /q "{temppath}{appname:regexreplace: \(.*\):}"

Share this post


Link to post
Share on other sites

Well, I don't know why it doesn't find the xcopy executable. I could only imagine that it is being searched for in the wrong directory, which may happen if the PATH environment variable is set incorrectly or the exe simply does not exist.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

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