We get information about the program and load it through CMD (man and apt-get for Windows?)

image

This article will discuss a very simple and convenient way to obtain data (information) about software and download / install via CMD . For implementation, the open API Xetcom.Export and Wget 1 were used . Unfortunately, the API is not properly documented, but, on the other hand, is quite simple - you can understand the essence after several test requests. The assembly itself consists of three independent .BAT files and the Wget package. Arm yourself with administrator rights and go.

Start

To get started, I advise you to play a little with the interpreter settings, and if more specifically - to configure the window view (Properties> Location). The width and height of the clipboard size is often confused with the window size. In short, this is the actual maximum scroll size. If the text does not fit in it, then automatically wraps to the next line. For this reason, the Maximize button on the command line “does not work”. The optimal parameters in my opinion are 150x300. A height of 300 means 300 lines, after which earlier entries disappear. The settings are more or less described here . And also, as an alternative, I advise you to try Console .

image
Font Lucida Console instead of point .

The composition of the SFX archive:

All archive files are unpacked in the % windir% folder . This allows you to call them directly - without specifying the path and without registering the path in the registry. The latter option allows you to run the program regardless of location, but you need to inform the registry about its location (branch SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ App Paths). The system utilities calc, mspaint, ping, etc. work in the same way. It is described in detail here .

And now, first things first.

man.bat
@ECHO OFF
CHCP 1251
%1
%2
CLS
SET title=%1
SET param=%2
IF "%title%" == "" (
ECHO Значение не указано
EXIT /B
)
IF "%param%" ==  ""  GOTO none
IF "%param%" == "-c" GOTO c
IF "%param%" == "-m" GOTO m
IF "%param%" == "-l" GOTO l
IF "%param%" == "-f" GOTO f
GOTO error
:none
wget --quiet "http://api.xetcom.com/export/index.php?format=dos&title=%1&description=1&info=1&features=1" -O "%title%.txt"
TYPE  "%title%.txt"
DEL "%title%.txt"
EXIT /B
:c
wget --quiet "http://api.xetcom.com/export/index.php?format=dos&title=%1&description=1&info=1&features=1&requirements=1" -O "%title%.txt"
TYPE  "%title%.txt"
DEL "%title%.txt"
EXIT /B
:m
wget --quiet "http://api.xetcom.com/export/index.php?format=dos&title=%1&description=1&info=1&features=1&requirements=1&xetindex=1" -O "%title%.txt"
TYPE  "%title%.txt"
DEL "%title%.txt"
EXIT /B
:l
wget --quiet "http://api.xetcom.com/export/index.php?format=dos&title=%1&description=1&info=1&features=1&requirements=1&xetindex=1&fileinfo=1" -O "%title%.txt"
TYPE  "%title%.txt"
DEL "%title%.txt"
EXIT /B
:f
wget --quiet "http://api.xetcom.com/export/index.php?format=dos&title=%1&description=1&info=1&features=1&requirements=1&xetindex=1&fileinfo=1&competitors=tranformed" -O "%title%.txt"
TYPE  "%title%.txt"
DEL "%title%.txt"
EXIT /B
:error
ECHO Указан неправильный параметр

Demonstration / output of information aimpimage

As you noticed, this batch file has options -c, -m, -l, -f (compact, medium, long, full, respectively). If you enter a command without a parameter, then the minimum information (program description + card + features) is entered. Each subsequent parameter adds more information. For clarity, see examples.

Examples

Google Chrome Summary
man google-chrome
Description: Google Chrome is the fastest growing browser, largely due to the open source code of Chromium, thanks to which it quickly releases new versions and at the same time, quickly eliminates all existing vulnerabilities. The browser has a simple minimalistic design, which facilitates surfing the web, as nothing distracts the user from the contents of the web page. The browser tabs are isolated, which, at the same time as increasing the reliability of the browser, makes visiting sites more secure. Chrome has a built-in JavaScript engine that significantly speeds up script processing and increases the speed of the Internet.

Developer: Google
Supported formats: HTML, HTM, SHTML, XHTML, TXT, TEXT, JPE, JPG, JPEG, GIF, MHTML, PNG, BMP, ICO, SVG, SVGZ, XML, PDF, SWF
Of. website: google.com
Paid alternative: e-Capsule Browser
Russian language: Available
Status: Freeware
Sources: Closed

Features:
- The only window for solving most problems.
- Application shortcuts and dynamic tabs.
- The ability to safely view questionable sites, as well as the presence of an "incognito" mode.
- The easy process of creating bookmarks, as well as the ability to import them from other browsers.
- High speed and reliability.
- Fully automatic update process.

Full Google Chrome info
man google-chrome -f
Description: Google Chrome is the fastest growing browser, largely due to the open source code of Chromium, thanks to which it quickly releases new versions and at the same time, quickly eliminates all existing vulnerabilities. The browser has a simple minimalistic design, which facilitates surfing the web, as nothing distracts the user from the contents of the web page. The browser tabs are isolated, which, at the same time as increasing the reliability of the browser, makes visiting sites more secure. Chrome has a built-in JavaScript engine that significantly speeds up script processing and increases the speed of the Internet.

Developer: Google
Supported formats: HTML, HTM, SHTML, XHTML, TXT, TEXT, JPE, JPG, JPEG, GIF, MHTML, PNG, BMP, ICO, SVG, SVGZ, XML, PDF, SWF
Of. website: google.com
Paid alternative: e-Capsule Browser
Russian language: Available
Status: Freeware
Sources: Closed

Features:
- The only window for solving most problems.
- Application shortcuts and dynamic tabs.
- The ability to safely view questionable sites, as well as the presence of an "incognito" mode.
- The easy process of creating bookmarks, as well as the ability to import them from other browsers.
- High speed and reliability.
- Fully automatic update process.

System Requirement:
Processor: 2200 MHz
RAM: 512 MB
Hard Disk: 100 MB
Audio
Card: Any compatible audio card Video Card: 64 MB
Architecture: x86 or x64
System: Windows XP, Windows Vista, Windows 7, Windows 8

Utility Index:
Speed: 100
Practicality: 100
Reliability: 100
Functionality: 100

File Information:
Silent installation: / install
Distribution options:
Installation only: Installer: Without toolbars
Certificate: Available

Competitors:
360-browser
safari
avant-browser
baidu-spark
blackhawk-browser
browzar
chrome-hybrid
chromium
cometbird-browser
comodo-dragon
comodo-icedragon
coolnovo
coowon
cyberfox
dooble
epic-browser
firefox
firefox-hybrid
greenbrowser
internet-explorer
k-meleon
lunascape-browser
maxthon-browser
opera
opera-hybrid
opera-unofficial
orbitum
orca-browser
pale-moon
qip-surf
qupzilla
seamonkey
sleipnir
slimbrowser
slimjet
srware-iron
superbird
theworld-browser
tor -browser-bundle
torch-browser
waterfox
wyzo
yandex-browser



get.bat
@echo off
chcp 1251
%1
%2
cls
set title=%1
set param=%2
IF "%param%" == "x64" GOTO x64
:x86
cd "%TMP%"
wget --quiet "http://api.xetcom.com/export/index.php?title=%title%&link=x86&format=dos" -O "%title%-x86.txt"
wget -i "%title%-x86.txt" -P %USERPROFILE%\Desktop
del "%title%-x86.txt"
Exit /B
:x64
cd "%TMP%"
wget --quiet "http://api.xetcom.com/export/index.php?title=%title%&link=x64&format=dos" -O "%title%-x64.txt"
wget -i "%title%-x64.txt" -P %USERPROFILE%\Desktop
del "%title%-x64.txt"
Exit /B

The principle of operation of this file I think will be unnecessarily described.

Demonstration / download aimp The
image

downloaded file is saved on the desktop (tested on Windows 7/8). Could not find XP desktop variable. Although there is a sophisticated solution, but for some reason it also does not work. The problem is that depending on the language, the path changes. For example, in the Russian version of% HOMEPATH% \ Desktop, in the English% HOMEPATH% \ Desktop, etc. In order not to spam the batch file with multi-line IFs, I decided to abandon this venture. XP users will have to fix the commands a bit. % HOMEPATH% or user folder, from there just one step to the desktop. Replace% USERPROFILE% \ Desktop with% HOMEPATH% \ change_me and you're done.

Automated phased download via another bat file:
cmd /c get 7-zip
cmd /c get opera
cmd /c get firefox



Installing " self-installing " programs
This trick requires one more request to the API - to get the key for silent installation (Unattended / Silent installation switch). It is also worth noting that not all programs support the “silent mode” of the installation or even initially portable ones (there are also a lot of them). In this case, after loading, the script will simply launch the file and wait for your action.

install.bat
@echo off
chcp 1251
%1
%2
cls
set title=%1
set param=%2
IF "%param%" == "x64" GOTO x64
:x86
:: Получение данных
cd "%TMP%"
wget --quiet "http://api.xetcom.com/export/index.php?title=%title%&link=x86&format=dos" -O "%title%-x86.txt"
wget -i "%title%-x86.txt" -P %TMP%
wget --quiet "http://api.xetcom.com/export/index.php?title=%title%&format=dos&silent_install=1" -O "%title%-x86-silent.txt"
:: Получение названии и расширении файла
set /p x86=<"%title%-x86.txt"
for /F %%i in ("%x86%") do set x86=%%~nxi
:: Запуск инсталлятора
set /p silent=<"%title%-x86-silent.txt"
cmd /c "%TMP%\%x86% %silent%"
:: Удаление оставшихся файлов
del "%TMP%\%x86%"
del "%title%-x86.txt"
del "%title%-x86-silent.txt"
Exit /B
:x64
:: Получение данных
cd "%TMP%"
wget --quiet "http://api.xetcom.com/export/index.php?title=%title%&link=x64&format=dos" -O "%title%-x64.txt"
wget -i "%title%-x64.txt" -P %TMP%
wget --quiet "http://api.xetcom.com/export/index.php?title=%title%&format=dos&silent_install=1" -O "%title%-x64-silent.txt"
:: Получение названии и расширении файла
set /p x64=<"%title%-x64.txt"
for /F %%i in ("%x64%") do set x64=%%~nxi
:: Запуск инсталлятора
set /p silent=<"%title%-x64-silent.txt"
cmd /c "%TMP%\%x64% %silent%"
:: Удаление оставшихся файлов
del "%TMP%\%x86%"
del "%title%-x64.txt"
del "%title%-x64-silent.txt"
Exit /B

Demonstration / automatic installation of burnaware image

A little automation or batch installation, or 1kb Windows WPI
::==========================::
::=========settings=========::
::==========================::
:: Браузеры
cmd /c install firefox
cmd /c install google-chrome
:: Архиваторы
cmd /c install 7-zip
:: Аудио
cmd /c install foobar200
:: Конвертеры
cmd /c install format-factory
:: Видео
cmd /c install k-lite-codec-pack
cmd /c install audacity
:: Графика
cmd /c install faststone-image-viewer
cmd /c install picpick
:: Система
cmd /c install ultradefrag
cmd /c install hashtab
:: Нужные вещи
cmd /c install adobe-flash-player
cmd /c install microsoft-silverlight
cmd /c install java x64
cmd /c install unlocker
:: Офис
cmd /c install notepad-plus-plus
cmd /c install libreoffice

SFX archive

Also popular now: