📜 ⬆️ ⬇️

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

image

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

Start

For the beginning I advise you to play a little with the settings of the interpreter, and if specifically, to adjust the appearance of the window (Properties> Location). The width and height of the clipboard size is often confused with the size of the window. In short, this is the actual maximum scroll size. If the text is not combined in it, then the automatic one is transferred to the next line. It is for this reason that the Maximize button on the command line "does not work." The optimal parameters in my opinion - 150x300. A height of 300 means 300 lines, after which the previous entries disappear. About the settings more or less described here . And also, as an alternative, I advise you to try Console .

image
Font Lucida Console instead of dots .
')
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 last option allows you to run the program regardless of its 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 about everything in order.

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 information aimp image

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

Examples

Google Chrome Brief
man google-chrome
Description: Google Chrome is the fastest growing browser, thanks in large part to the open source Chromium code, thanks to which it quickly releases new versions and, at the same time, quickly eliminates all existing vulnerabilities. The browser has a simple minimalist design that facilitates Internet surfing, since nothing distracts the user from the content of the web page. Browser tabs are isolated, which, along with improving 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 work on 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 equivalent: e-Capsule Browser
Russian language: Available
Status: Freeware
Sources: Closed

Features:
- The only window for most tasks.
- Application shortcuts and dynamic tabs.
- Ability to safely browse questionable sites, as well as the presence of the regime "incognito".
- 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 information
man google-chrome -f
Description: Google Chrome is the fastest growing browser, thanks in large part to the open source Chromium code, thanks to which it quickly releases new versions and, at the same time, quickly eliminates all existing vulnerabilities. The browser has a simple minimalist design that facilitates Internet surfing, since nothing distracts the user from the content of the web page. Browser tabs are isolated, which, along with improving 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 work on 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 equivalent: e-Capsule Browser
Russian language: Available
Status: Freeware
Sources: Closed

Features:
- The only window for most tasks.
- Application shortcuts and dynamic tabs.
- Ability to safely browse questionable sites, as well as the presence of the regime "incognito".
- 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 Requirements:
Processor: 2200 MHz
RAM: 512 MB
Hard Drive: 100 MB
Sound card: Any compatible sound card
Video Card: 64 MB
Architecture: x86 or x64
System: Windows XP, Windows Vista, Windows 7, Windows 8

Utility Index:
Speed: 100
Practical: 100
Reliability: 100
Functionality: 100

File Information:
Silent installation: / install
Distribution options: Only installation
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 unduly describe.

Demonstrating / loading aimp
image

The downloaded file is saved on the desktop (checked on Windows 7/8). Could not find desktop variable xp. Although there is a sophisticated solution, but for some reason it does not work either. The problem is that depending on the language, the path changes. For example, in the Russian version of% HOMEPATH% \ Desktop, in English% HOMEPATH% \ Desktop, etc. In order not to spam a batch file with multiline IF, I decided to abandon this idea. XP users will have to tweak some commands. % HOMEPATH% or user folder, from there just one step to the desktop. Replace% USERPROFILE% \ Desktop with% HOMEPATH% \ change_me and 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 another request to the API to get the silent installation key (Unattended / Silent installation switch). Another thing to note is that not all programs support the “silent mode” of the installation or, generally, initially portable ones (there are a lot of them too). In this case, after downloading the script will simply run the file and will 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 Windows WPI size of 1kb
 ::==========================:: ::=========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

Source: https://habr.com/ru/post/239443/


All Articles