w10install/optional/install-irfanview.cmd
2023-01-19 14:31:37 +01:00

127 lines
1.3 KiB
Batchfile

@echo off
call check-for-admin
if %ERRORLEVEL% neq 0 exit /b
set EXE=..\software\iview-setup.exe
set STARTMENU="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs"
set TARGET=%PROGRAMFILES%\IrfanView
if NOT EXIST %EXE% (
echo ERROR: %EXE% not found!
pause
exit /b
)
echo ####### %0 #######
echo installing IrfanView ...
start /wait %EXE% /silent /desktop=1 /thumbs=1 /folder="%TARGET%" /group=1 /allusers=1
echo removing IrfanView startmenu folder ...
rd /S /Q %STARTMENU%\"IrfanView" 2>nul
echo moving IrfanView desktop links to Startmenu ...
mkdir %STARTMENU%\IrfanView 2>nul
move /Y "%PUBLIC%\Desktop\IrfanView*.lnk" %STARTMENU%\IrfanView
rem refresh desktop (W10 style)
ie4uinit.exe -show
for %%A in (
acr
ani
b3d
bmp
dib
clp
crw
cr2
cr3
cur
dcm
ima
dcx
dds
djvu
iw44
dxf
ecw
emf
eps
ps
exr
g3
gif
hdp
jxr
wdp
heic
ico
iff
lbm
jls
jp2
jpc
j2k
jpg
jpeg
jpe
jpm
mng
jng
pbm
pcd
pcx
pgm
png
ppm
psd
psp
ras
sun
raw
rle
sff
sgi
rgb
sid
tga
tif
tiff
wbmp
webp
wmf
xbm
xpm
swf
flv
ttf
asf
avi
mpg
mpe
mpeg
mov
wmv
aif
mid
rmi
mp3
ogg
au
snd
wav
wma
) do (
echo registering file type [ .%%A ] ...
sfta --reg "%TARGET%\i_view64.exe" ".%%A
)
echo ####### %0 #######
pause