Difference between revisions of "Anri-chan/Source/install.bat"

From SDA Knowledge Base

Jump to: navigation, search
(location of desktop should be dynamic (less so in vista unfortunately) and installing multiple times from the same install dir should be ok now)
 
(2b2)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<pre><nowiki>@echo off
+
<pre><nowiki>
 +
@echo off
  
(SET anri_ver=1)
 
 
set installdir=anrichan
 
set installdir=anrichan
  
 
REM get the desktop name, dependant on whether we start in system32 (vista, running install.bat as administrator) or not
 
IF NOT "%CD%"=="%WINDIR%\system32" GOTO previstadesktop
 
REM vista support is not as good because i can't reach sed from system32 ... have to resort to this FOR command which depends on the fourth item in the path to the desktop being the name of the desktop
 
FOR /F "TOKENS=4 DELIMS=\" %%D IN ('REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /V Desktop') DO SET DESKTOP=%%D
 
REM CD "%HOMEPATH%\%DESKTOP%\anrichan-%anri_ver%"
 
 
CD "%~dp0"
 
CD "%~dp0"
GOTO desktoprefork
 
 
:previstadesktop
 
XCOPY /Y installdata\anridesktoploc.bat.bak installdata\anridesktoploc.bat
 
REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /V "Desktop" | installdata\sed -n s/.\+REG_SZ.\+\\\(.\+\)[^\\]*/\1/gp >> installdata\anridesktoploc.bat
 
CALL installdata\anridesktoploc.bat
 
XCOPY /Y installdata\anridesktoploc.bat.bak installdata\anridesktoploc.bat
 
 
:desktoprefork
 
  
 +
REM name of the desktop
 +
XCOPY /Y /Q data\anridesktoploc.bat.bak data\anridesktoploc.bat
 +
REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /V "Desktop" | data\sed -n s/.\+REG_SZ.\+\\\(.\+\)[^\\]*/\1/gp >> data\anridesktoploc.bat
 +
CALL data\anridesktoploc.bat
 +
XCOPY /Y /Q data\anridesktoploc.bat.bak data\anridesktoploc.bat
  
 
echo You must accept the terms of the license agreement to use this software. To agree, press any key. To disagree, click the X to close this installer.
 
echo You must accept the terms of the license agreement to use this software. To agree, press any key. To disagree, click the X to close this installer.
Line 35: Line 25:
  
 
CD "%~dp0"
 
CD "%~dp0"
 
REM dlls
 
xcopy /Y installdata\msvcr71.dll "%WINDIR%\system32"
 
  
 
REM program files location
 
REM program files location
 
xcopy /Y installdata\pftemplate.txt installdata\pf.bat
 
xcopy /Y installdata\pftemplate.txt installdata\pf.bat
echo %PROGRAMFILES%| installdata\sed "s/\\/\\\\/g" >> installdata\pf.bat
+
echo %PROGRAMFILES%| data\sed "s/\\/\\\\/g" >> installdata\pf.bat
 
call installdata\pf.bat
 
call installdata\pf.bat
  
 
REM drive letter stuff
 
REM drive letter stuff
installdata\sed "s/C:\\Program Files/%pf%/g" installdata\template.avs > template.avs
+
data\sed "s/C:\\Program Files/%pf%/g" installdata\mvbob.avs > mvbob.avs
MOVE /Y template.avs data\dgmpgdec149
+
installdata\sed "s/C:\\Program Files/%pf%/g" installdata\template_mpa.avs > template_mpa.avs
+
MOVE /Y template_mpa.avs data\dgmpgdec149
+
installdata\sed "s/C:\\Program Files/%pf%/g" installdata\mvbob.avs > mvbob.avs
+
 
MOVE /Y mvbob.avs installdata\plugins
 
MOVE /Y mvbob.avs installdata\plugins
installdata\sed "s/C:\\Program Files/%pf%/g" installdata\nate.avs > nate.avs
+
data\sed "s/C:\\Program Files/%pf%/g" installdata\nate.avs > nate.avs
 
MOVE /Y nate.avs data
 
MOVE /Y nate.avs data
installdata\sed "s/C:\\Program Files/%pf%/g" installdata\nondvdtemplate.avs > nondvdtemplate.avs
+
data\sed "s/C:\\Program Files/%pf%/g" installdata\nondvdtemplate.avs > nondvdtemplate.avs
 
MOVE /Y nondvdtemplate.avs data
 
MOVE /Y nondvdtemplate.avs data
  
Line 66: Line 49:
 
xcopy /Y /E data "%PROGRAMFILES%\%installdir%"
 
xcopy /Y /E data "%PROGRAMFILES%\%installdir%"
  
installdata\xxmklink "%HOMEPATH%\%DESKTOP%\Anri-chan" "%PROGRAMFILES%\%installdir%\anri.bat" "" "%SYSTEMDRIVE%%HOMEPATH%\%DESKTOP%" "ON HERMESUS LUC ARSUS ESTARIAS AUC ELTRAS LI CELES!" 1 "%PROGRAMFILES%\%installdir%\anri.ico"  
+
installdata\xxmklink "%HOMEPATH%\%DESKTOP%\Anri-chan" "%PROGRAMFILES%\%installdir%\runatlow.bat" "" "%PROGRAMFILES%\%installdir%" "ON HERMESUS LUC ARSUS ESTARIAS AUC ELTRAS LI CELES!" 1 "%PROGRAMFILES%\%installdir%\anri.ico"  
 
installdata\xxmklink "%HOMEPATH%\%DESKTOP%\Station ID Preview" "%PROGRAMFILES%\%installdir%\statid.bat" "" "%SYSTEMDRIVE%%HOMEPATH%\%DESKTOP%" "ON HERMESUS LUC ARSUS ESTARIAS AUC ELTRAS LI CELES!" 1 "%PROGRAMFILES%\%installdir%\anri.ico"  
 
installdata\xxmklink "%HOMEPATH%\%DESKTOP%\Station ID Preview" "%PROGRAMFILES%\%installdir%\statid.bat" "" "%SYSTEMDRIVE%%HOMEPATH%\%DESKTOP%" "ON HERMESUS LUC ARSUS ESTARIAS AUC ELTRAS LI CELES!" 1 "%PROGRAMFILES%\%installdir%\anri.ico"  
 
installdata\xxmklink "%HOMEPATH%\%DESKTOP%\Extract Sample" "%PROGRAMFILES%\%installdir%\sample.bat" "" "%SYSTEMDRIVE%%HOMEPATH%\%DESKTOP%" "ON HERMESUS LUC ARSUS ESTARIAS AUC ELTRAS LI CELES!" 1 "%PROGRAMFILES%\%installdir%\anri.ico"  
 
installdata\xxmklink "%HOMEPATH%\%DESKTOP%\Extract Sample" "%PROGRAMFILES%\%installdir%\sample.bat" "" "%SYSTEMDRIVE%%HOMEPATH%\%DESKTOP%" "ON HERMESUS LUC ARSUS ESTARIAS AUC ELTRAS LI CELES!" 1 "%PROGRAMFILES%\%installdir%\anri.ico"  
  
 
cls
 
cls
echo Anri-chan %anri_ver% is now installed! Start Anri-chan by double-clicking the Anri-chan icon on your desktop.
+
echo Anri-chan is now installed! Start Anri-chan by double-clicking the Anri-chan icon on your desktop.
 
pause
 
pause
  
 
@echo on
 
@echo on
 
</nowiki></pre>
 
</nowiki></pre>

Latest revision as of 23:15, 11 November 2007

@echo off

set installdir=anrichan

CD "%~dp0"

REM name of the desktop
XCOPY /Y /Q data\anridesktoploc.bat.bak data\anridesktoploc.bat
REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /V "Desktop" | data\sed -n s/.\+REG_SZ.\+\\\(.\+\)[^\\]*/\1/gp >> data\anridesktoploc.bat
CALL data\anridesktoploc.bat
XCOPY /Y /Q data\anridesktoploc.bat.bak data\anridesktoploc.bat

echo You must accept the terms of the license agreement to use this software. To agree, press any key. To disagree, click the X to close this installer.
start "gpl" notepad.exe license.txt
pause
cls

echo Let's start by installing AviSynth 2.5.7. Just keep hitting "agree" or "next" in the installer that appears.
echo If you already have AviSynth 2.5.7 or newer installed, then you can skip this step by simply quitting the installer after it opens.
echo Please do not continue with this installer until AviSynth is successfully installed. Press any key to begin installation.
pause

installdata\Avisynth_257.exe

CD "%~dp0"

REM program files location
xcopy /Y installdata\pftemplate.txt installdata\pf.bat
echo %PROGRAMFILES%| data\sed "s/\\/\\\\/g" >> installdata\pf.bat
call installdata\pf.bat

REM drive letter stuff
data\sed "s/C:\\Program Files/%pf%/g" installdata\mvbob.avs > mvbob.avs
MOVE /Y mvbob.avs installdata\plugins
data\sed "s/C:\\Program Files/%pf%/g" installdata\nate.avs > nate.avs
MOVE /Y nate.avs data
data\sed "s/C:\\Program Files/%pf%/g" installdata\nondvdtemplate.avs > nondvdtemplate.avs
MOVE /Y nondvdtemplate.avs data

REM INSTALLDATA
set backupsuf=anribak.%RANDOM%
md "%PROGRAMFILES%\AviSynth 2.5\plugins.%backupsuf%"
xcopy /Y /E "%PROGRAMFILES%\AviSynth 2.5\plugins" "%PROGRAMFILES%\AviSynth 2.5\plugins.%backupsuf%"
xcopy /Y /E installdata\plugins "%PROGRAMFILES%\AviSynth 2.5\plugins"

REM DATA
md "%PROGRAMFILES%\%installdir%"
xcopy /Y /E data "%PROGRAMFILES%\%installdir%"

installdata\xxmklink "%HOMEPATH%\%DESKTOP%\Anri-chan" "%PROGRAMFILES%\%installdir%\runatlow.bat" "" "%PROGRAMFILES%\%installdir%" "ON HERMESUS LUC ARSUS ESTARIAS AUC ELTRAS LI CELES!" 1 "%PROGRAMFILES%\%installdir%\anri.ico" 
installdata\xxmklink "%HOMEPATH%\%DESKTOP%\Station ID Preview" "%PROGRAMFILES%\%installdir%\statid.bat" "" "%SYSTEMDRIVE%%HOMEPATH%\%DESKTOP%" "ON HERMESUS LUC ARSUS ESTARIAS AUC ELTRAS LI CELES!" 1 "%PROGRAMFILES%\%installdir%\anri.ico" 
installdata\xxmklink "%HOMEPATH%\%DESKTOP%\Extract Sample" "%PROGRAMFILES%\%installdir%\sample.bat" "" "%SYSTEMDRIVE%%HOMEPATH%\%DESKTOP%" "ON HERMESUS LUC ARSUS ESTARIAS AUC ELTRAS LI CELES!" 1 "%PROGRAMFILES%\%installdir%\anri.ico" 

cls
echo Anri-chan is now installed! Start Anri-chan by double-clicking the Anri-chan icon on your desktop.
pause

@echo on
Personal tools