Author Topic: Do not update / backup user modified files [hand-made solution]  (Read 5894 times)

paragon

  • Guest
Do not update / backup user modified files [hand-made solution]
« on: September 11, 2014, 10:43:47 AM »

I can do it manually for sure, but if it's not hard, it could be useful.
hotkeys.ini, NameColorizing.txt, DataFiles.cfg, Fonline.cfg
« Last Edit: September 13, 2014, 03:42:58 AM by paragon »
Logged

paragon

  • Guest
Re: Do not update / backup user modified files
« Reply #1 on: September 13, 2014, 03:27:24 AM »

Windows run script for FOnline.exe, put it to the game folder and run from there.

It makes back ups for *.cfg *.ini *.txt *.cmd to the folder AoP-client-config-backup next to the folder it has been run from.
Than it runs update-colorizer.cmd
Than it runs FOnline.exe

Back up is made with date-time so you'll have all copies if there're changes.

Don't forget to set up in properties of shortcut "run minimized" to hide the script window.

https://www.dropbox.com/sh/z9zxk2vn49jbe85/AABp3u5d88r0nxNDrrxBPR9Va?dl=0

Spoiler for Source:
@REM coding:OEM
SETLOCAL ENABLEEXTENSIONS
SET scriptdir=%~dp0
REM remove trailing backslash
SET scriptdir=%scriptdir:~0,-1%
SET backupsdir=%scriptdir%-config-backup

IF NOT EXIST "%backupsdir%" MKDIR "%backupsdir%"
FOR %%I IN (*.cfg *.ini *.txt *.cmd) DO CALL :copyWithBackup "%%~I"

CALL update-colorizer.cmd
START "" "FOnline.exe"

EXIT /B

:copyWithBackup <source>
    SET dest=%backupsdir%\%~nx1
    IF EXIST "%dest%" (
   FC /B %1 "%dest%" >NUL
   rem 2 = one of files cannot be read
   IF ERRORLEVEL 2 (PAUSE & EXIT)
   rem 1 = different
   IF ERRORLEVEL 1 CALL :renameByDate "%dest%"
   rem 0 = no difference
    )
   
    XCOPY %1 "%backupsdir%" /Y
EXIT /B

:renameByDate <file>
    FOR %%J IN (%1) DO SET datetime=%%~tJ
    SET destname=%1 %datetime::=%
    REN %1 "%destname%"
EXIT /B
« Last Edit: September 14, 2014, 07:36:30 AM by paragon »
Logged

paragon

  • Guest
Re: Do not update / backup user modified files
« Reply #2 on: September 13, 2014, 03:40:58 AM »

Downloads colorizing from inputted URL. Don't forget to change it until you want to download mine (:
Put it in the folder you want to have your downloaded file (probably game folder)
Put wget.exe in the folder with the script. For example, http://gnuwin32.sourceforge.net/packages/wget.htm (official)

Spoiler for colorizer-update.cmd source:
@REM coding:OEM
REM get wget anywhere, for example http://gnuwin32.sourceforge.net/packages/wget.htm (official)
REM or http://eternallybored.org/misc/wget/ (newer)
wget.exe --no-check-certificate -N https://dl.dropboxusercontent.com/u/100575405/NameColorizing.txt

https://dl.dropboxusercontent.com/u/100575405/colorizer-update.cmd
« Last Edit: September 14, 2014, 07:36:57 AM by paragon »
Logged

paragon

  • Guest
Re: Do not update / backup user modified files [hand-made solution]
« Reply #3 on: September 14, 2014, 07:38:09 AM »

update-colorizer.ahk : auto replace some nicks with yours (e.g. if your colorize maker puts his nicknames in special section. AutoHotKey required

https://www.dropbox.com/sh/z9zxk2vn49jbe85/AABp3u5d88r0nxNDrrxBPR9Va?dl=0
Logged

FlyWheenRunner

  • Wanderer
  • *
  • Offline Offline
  • Posts: 1
    • View Profile
Re: Do not update / backup user modified files [hand-made solution]
« Reply #4 on: September 14, 2014, 08:45:34 AM »

I'd like to +1 that, but here is no way to do so.
Logged

paragon

  • Guest
Re: Do not update / backup user modified files [hand-made solution]
« Reply #5 on: September 14, 2014, 08:59:24 AM »

Cus it's yours xD
Logged
 



SMF 2.0.2 | SMF © 2011, Simple Machines
Simple Audio Video Embedder - Theme by Crip