Sphinx Posted March 8, 2010 Report Share Posted March 8, 2010 Hello I just thought I'd share a tip on how I update software that doesn't use installers, but may be in use when Ketarin downloads an update, guess the keyword for this tip/technique is in use, since if it's not in use you can just unpack it to the folder where you have your old version. In my example I will use Ketarin itself, I also use this for Miranda IM (which has an installer, I know, but I don't use all the plugins so i prefer to use the zip when updating) and Flexible Renamer. For this tip/tuturial you will need two other programs in addition to Ketarin, those are PendMoves and MoveFile, two programs written by SysInternals, now bought by Microsoft (they are still free), and they are available here http://technet.microsoft.com/en-us/sysinternals/bb897556.aspx After Ketarin has downloaded an update for itself i run this command in the "Execute the following command after downloading:" box "C:\program\Winrar\winrar.exe" E -ac -ibck -o+ "{file}" "C:\Ketarin_temp\Ketarin\" && "C:\Ketarin_temp\ketarin.bat" This extracts the files to the temp folder I have picked to use, marked in green, you may choose to use a different folder, it's up to you, and of course you can use any unpacking software you choose Now after Ketarin has run the command that unpacks the files, it will run a bat file (marked with red) This is where MoveFile comes in. In my .bat file, the following commands are run cmdow @ /HID @ECHO OFF movefile "c:\program\Ketarin\Ketarin.exe" "" movefile "c:\program\Ketarin\System.Data.SQLite.dll" "" movefile "C:\Ketarin_temp\Ketarin\Ketarin.exe" "c:\program\Ketarin\Ketarin.exe" movefile "C:\Ketarin_temp\Ketarin\System.Data.SQLite.dll" "c:\program\Ketarin\System.Data.SQLite.dll" EXIT The first part cmdow @ /HID are optional, what they do it hide the command window (for the cmdow @ /HID command you'll need another piece of software available here) The second command @ECHO OFF will tell the command window not to show any text output of the commands that are following The first file commands movefile "c:\program\Ketarin\Ketarin.exe" "" movefile "c:\program\Ketarin\System.Data.SQLite.dll" "" will tell windows that on the next reboot, delete these files, these are the old files, then ones you want replaced with new version, now you may wonder why not just copy the files over the old ones, well it's, simply put, because of how movefile works The following commands movefile "C:\Ketarin_temp\Ketarin\Ketarin.exe" "c:\program\Ketarin\Ketarin.exe" movefile "C:\Ketarin_temp\Ketarin\System.Data.SQLite.dll" "c:\program\Ketarin\System.Data.SQLite.dll" will tell windows to move the new files from the temp folder into the folder where you had your old files. And the last command EXIT will quit the command window, even if it's not shown Notes This tip/technique will only update your software after a reboot, so it you want a faster update you'll need to quit your running program and update yourself The movefile and cmdow programs must be either in your Windows/System32 folder or in the same folder as your bat/cmd file Now you may wonder what you needed the PendMoves program for, well, this command tool will check what files will be moved on the next reboot, which can be of help to you when you write your own .bat/.cmd file to check if you have written the filepaths correct or not (after you have manually run the .bat/.cmd file) I hope this may be of use to someone. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now