After more than half a month of learning VBS and HTML, combined with some experiences in computer maintenance, I have written this super-powered one-click software installation manager. It is mainly used for installing portable software, and can also be used for installing non-portable software. It also supports batch extraction (requiring support for RAR 3.7 or above).
I would like to express special thanks to Brother ZH159 and other brothers and friends for their support in the production of this program. Here, I extend my special thanks. The program interface refers to Brother ZH159's "Who Says Batch Processing Interfaces Can't Be Beautiful".
This software supports installation in CMD interface and WINDOWS graphical interface mode; supports automatic identification and conversion of traditional and simplified Chinese languages; supports batch installation, batch portable software repair, batch extraction; supports production of installation scripts.
The program is made based on BAT + VBS + HTML. The following briefly explains the main functions:
I have given 4 installation methods. The first conventional method can not only be used to batch install portable software (requiring GSETUP.BAT for portability setup in the portable software, and must be compressed with WINRAR or 7ZIP), but also can batch install ordinary EXE software; the second one only installs EXE compressed packages specially made with WINRAR. How is it special? In fact, it is that when compressing the portable software, the GSETUP.BAT inside is automatically called when the portable software is extracted, which simplifies the installation process. Most of my portable software are in this mode, which is relatively convenient. It can be installed manually or using the RAR command to extract and install. The third mode means repairing the installed portable software. The reason is very simple. If the system is reinstalled, the original portable software cannot be used anymore. Then this repair function can be simply used to automatically traverse the GSETUP.BAT existing in the specified directory and execute it. The fourth one is to directly traverse the UINSTALL.BAT in the specified directory to delete the portable software.
Regarding the production of the script, actually, the FOR command and RAR command are used to obtain all EXE, RAR, 7Z software in the directory and subdirectories, and write their comments to a file. There are two advantages of making the installation script. One is to speed up the installation speed and avoid automatically obtaining the software list in the directory and subdirectories each time during installation; the second is to obtain the comments, and users can re-make the comments to be used as installation instructions. In the IE interface, these comments can be read out for users' reference.
I have uploaded the compressed package of the entire software. Please do not change the file names inside, otherwise errors may occur. After decompressing the compressed package, put it in the directory or parent directory where the software needs to be installed.
[ Last edited by HUNRYBECKY on 2007-3-10 at 01:44 AM ]
I would like to express special thanks to Brother ZH159 and other brothers and friends for their support in the production of this program. Here, I extend my special thanks. The program interface refers to Brother ZH159's "Who Says Batch Processing Interfaces Can't Be Beautiful".
This software supports installation in CMD interface and WINDOWS graphical interface mode; supports automatic identification and conversion of traditional and simplified Chinese languages; supports batch installation, batch portable software repair, batch extraction; supports production of installation scripts.
The program is made based on BAT + VBS + HTML. The following briefly explains the main functions:
I have given 4 installation methods. The first conventional method can not only be used to batch install portable software (requiring GSETUP.BAT for portability setup in the portable software, and must be compressed with WINRAR or 7ZIP), but also can batch install ordinary EXE software; the second one only installs EXE compressed packages specially made with WINRAR. How is it special? In fact, it is that when compressing the portable software, the GSETUP.BAT inside is automatically called when the portable software is extracted, which simplifies the installation process. Most of my portable software are in this mode, which is relatively convenient. It can be installed manually or using the RAR command to extract and install. The third mode means repairing the installed portable software. The reason is very simple. If the system is reinstalled, the original portable software cannot be used anymore. Then this repair function can be simply used to automatically traverse the GSETUP.BAT existing in the specified directory and execute it. The fourth one is to directly traverse the UINSTALL.BAT in the specified directory to delete the portable software.
Regarding the production of the script, actually, the FOR command and RAR command are used to obtain all EXE, RAR, 7Z software in the directory and subdirectories, and write their comments to a file. There are two advantages of making the installation script. One is to speed up the installation speed and avoid automatically obtaining the software list in the directory and subdirectories each time during installation; the second is to obtain the comments, and users can re-make the comments to be used as installation instructions. In the IE interface, these comments can be read out for users' reference.
I have uploaded the compressed package of the entire software. Please do not change the file names inside, otherwise errors may occur. After decompressing the compressed package, put it in the directory or parent directory where the software needs to be installed.
@ECHO OFF
REM RMODLE is the software running mode, either RCMD version or graphical interface version RGRAPTH. If it is RCMD mode, need to set INSTALLMODLE: M1 ordinary installation; M2 specific compressed package installation; M3 portable software one-click repair; M4 portable software one-click uninstall
mode con cols=20 lines=1
SET TIMEOUT=3
SET PATH=%CD%;%CD%\TOOLS\;%PATH%
SET RMODLE=RCMD
REM CMDOW @ /DIS
FOR /F "TOKENS=1,2 DELIMS=: " %%I IN ('CHCP') DO SET LAN=%%J
IF "%JUT%"=="1" GOTO CHS
IF "%LAN%"=="936" GOTO :CHS
IF "%LAN%"=="437" GOTO :CHS
:CHT
SET JUT=1
START /WAIT CT.EXE /B /S "ONEGSETUP.BAT" /D "ONEGSETUPCHT.BAT"
START /B/WAIT ONEGSETUPCHT.BAT
IF EXIST ONEGSETUPCHT.BAT DEL ONEGSETUPCHT.BAT
EXIT
:CHS
CLS
>Temp.vbs Echo intAnswer = MsgBox("To perform graphical interface installation under WINDOWS, please choose Yes (Y), otherwise only install under CMD!" , vbQuestion+vbYesNo, "Little Dot's Warm Tip!")
>>Temp.vbs Echo IF intAnswer = vbYes THEN
>>Temp.vbs Echo Wscript.Echo "RGRAPTH"
>>Temp.vbs Echo ELSEIF intAnswer = vbNo THEN
>>Temp.vbs Echo Wscript.Echo "RCMD"
>>Temp.vbs Echo END If
For /f "delims=" %%A In ('"cscript //nologo Temp.vbs"') do (GOTO :%%A)
:RCMD
CLS
mode con cols=70 lines=30
ECHO.
ECHO One-Click Installation Manager V1.0 can realize the following functions
ECHO 1. Install portable software according to *G.EXE in subdirectories; 2. Can also be used for non-portable software installation
ECHO Tip: This program can generally only be used for the installation of portable software made by myself; to install non-portable software, please change the file name
ECHO.
ECHO ╔──────────────────────────────╗
ECHO │ │
ECHO │ One-Click Installation Manager V1.0 │
ECHO │ This program is written and produced by Xiaobudian (Qiuyu) │
ECHO │ Welcome to use the portable software and other programs made by Xiaobudian │
ECHO │ This program can be freely copied, used and published, and the copyright belongs to the author himself │
ECHO │ QQ:9399100 QQ group number:29946542 E-MAIL:xiaobudian528@sina.com │
ECHO │ │
ECHO ╚──────────────────────────2007─㊣╝
ECHO.
ECHO Preparing for cleaning, please wait.........
PING 127.0.0.1 -n %TIMEOUT% >NUL
mode con cols=20 lines=1
REM Set installation directory IPATH. The last symbol of the installation directory cannot be \, otherwise it will not be able to install
:IPATH
>"%TEMP%\Temp.vbs" Echo intAnswer = inputbox("Please enter the directory to be installed. Do not enter the last \ symbol when entering. The default is D:\GRENN","Installation Directory","D:\GREEN")
>>"%TEMP%\Temp.vbs" Echo Wscript.Echo intAnswer
For /f "delims=" %%A In ('"cscript //nologo "%TEMP%\Temp.vbs""') do (SET IPATH=%%A)
IF NOT DEFINED IPATH GOTO :IPATH
REM Jump to the corresponding installation mode. If directly setting the installation mode can use: FOR /F %%I IN ("%INSTALLMODLE%") DO (GOTO :%%I) or IF "%INSTALLMODLE%"=="%INSTALLMODLE%" GOTO :%INSTALLMODLE%
:INSTALLMODLE
>"%TEMP%\Temp.vbs" Echo intAnswer = inputbox("Please enter the installation mode, which must be uppercase English letters:" + vbCrlf + "M1: One-click ordinary installation, can install ordinary software or portable software;" + vbCrlf + "M2: One-click portable software installation, install specific EXE compressed portable software;" + vbCrlf + "M3: One-click portable software repair, can repair installed portable software" + vbCrlf + "M4: One-click portable software uninstall, can delete installed portable software;" + vbCrlf + "GL: Make installation script, can generate installation file list","Installation Mode","M1")
>>"%TEMP%\Temp.vbs" Echo Wscript.Echo intAnswer
For /f "delims=" %%I In ('"cscript //nologo "%TEMP%\Temp.vbs""') do (SET INSTALLMODLE=%%I)
IF NOT DEFINED INSTALLMODLE GOTO :INSTALLMODLE
IF "%INSTALLMODLE%"=="M1" (SET ISF=*.EXE *.RAR *.7Z) ELSE (SET ISF=*G.EXE)
IF EXIST "InStallList.TXT" (SET ISL=InStallList.TXT) ELSE (SET ISL='DIR /S/B/O:N %ISF%')
IF EXIST "InStallList.TXT" (SET ETD=EOL=;TOKENS=1-2 DELIMS=:) ELSE (SET ETD=DELIMS=)
IF "%INSTALLMODLE%"=="%INSTALLMODLE%" GOTO :%INSTALLMODLE%
:RGRAPTH
REM Generate background image and configure IE button color needed by IE
REM mode con cols=20 lines=1
if exist bg.gif del /f/q bg.gif>nul
echo str="47494638396101000400800000F0F0F0ECECEC2C0000000001000400000203041205003B">>debug.vbs
echo with wscript.stdout:r=vbcrlf:for i=1 to len(str) step 48:.write "e"+hex(256+(i-1)/2):for j=i to i+46 step 2:.write " "+mid(str,j,2):next:.write r:next>>debug.vbs
echo .write "rbx"+r+"0"+r+"rcx"+r+"24"+r+"n debug.tmp"+r+"w"+r+"q"+r:end with>>debug.vbs
cscript //nologo debug.vbs|debug.exe>nul&&rename debug.tmp bg.gif&&del debug.vbs
set "button=border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2);cursor:hand;color:#ffffff;"
set "Pagebutton=border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2)"
set "Pagedisabled=border: 1 solid #b1b1b1;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f5f5f5,endColorStr=#b1b1b1)"
REM Minimize all windows
>%Temp%\Temp.vbs echo set WshShell = Wscript.CreateObject("Wscript.Shell")
>>%Temp%\Temp.vbs echo set minWA= Wscript.CreateObject("Shell.Application")
>>%Temp%\Temp.vbs echo minWA.MinimizeAll
cscript //nologo "%Temp%\Temp.vbs"
REM Use VBS to set IE properties
>%Temp%\Temp.vbs echo 'Reference the internetexplorer.application object of shdocvw.dll. If fullscreen=1, there is no title bar
>>%Temp%\Temp.vbs echo set WshShell = Wscript.CreateObject("Wscript.Shell")
>>%Temp%\Temp.vbs echo set ie=wscript.createobject("internetexplorer.application","event_")
>>%Temp%\Temp.vbs echo ie.fullscreen=1
>>%Temp%\Temp.vbs echo ie.menubar=0
>>%Temp%\Temp.vbs echo ie.addressbar=0
>>%Temp%\Temp.vbs echo ie.toolbar=0
>>%Temp%\Temp.vbs echo ie.statusbar=0
>>%Temp%\Temp.vbs echo ie.resizable=0
>>%Temp%\Temp.vbs echo ie.width=600
>>%Temp%\Temp.vbs echo ie.height=400
>>%Temp%\Temp.vbs echo ie.navigate "about:blank"
>>%Temp%\Temp.vbs echo ie.left=fix((ie.document.parentwindow.screen.availwidth-ie.width)/2)
>>%Temp%\Temp.vbs echo ie.top=fix((ie.document.parentwindow.screen.availheight-ie.height)/2)
>>%Temp%\Temp.vbs echo ie.visible=1
REM Use VBS to make HTML
>>%Temp%\Temp.vbs echo with ie.document
>>%Temp%\Temp.vbs echo .write "<html><title>One-Click Installation Manager</title><meta http-equiv='Content-Type' content='text/html; charset=gbk'>"
>>%Temp%\Temp.vbs echo .write "<style type='text/css' id='css'>.button {font: 15px 宋体, Verdana;height:32px;width:100px;}</style>"
>>%Temp%\Temp.vbs echo .write "<body onload=sf() background='%CD%\bg.gif' bgcolor=#e3e5da oncontextmenu='return false' scroll=yes style='font-family:宋体;font-size:15px;'>"
>>%Temp%\Temp.vbs echo .write "<table align=center style='font-family:楷体_gb2312;font-size:24px;'><td><b>One-Click Installation Manager V1.0</b></td></table>"
>>%Temp%\Temp.vbs echo .write "<table width=550 align=center style='FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde)'><td align=left style='font-size:1px;'> </td></table>"
>>%Temp%\Temp.vbs echo .write "<table width=550 align=center borderColor=#698cc2 border=1 cellSpacing=0 cellpadding=5 style='font-size:15px;border:#5a7dde 3px solid;'>"
>>%Temp%\Temp.vbs echo .write "<tr><td align=center bgcolor=#698cc2 style='FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde)' colspan=4><b><font style=font-size:18px;color:#ffffff;> Welcome to use One-Click Installation Manager </font><br><font style=color:#d0d0d0;><a title='China DOS Union Forum'>QQ:9399100</a> <a title='Refer to the IE batch processing interface written by zh159 brother'>EMAIL:xiaobudian528@yahoo.com.cn</a></font></b></td></tr>"
>>%Temp%\Temp.vbs echo .write "<tr><td align=left colspan=4><b>Select the software to be installed below, then click Install</td><tr>"
>>%Temp%\Temp.vbs echo .write "<tr align=center><td colspan=1><b>Software Name</b></td><td colspan=3><b>Software Description</b></td><tr>"
CALL :InStallList
>>%Temp%\Temp.vbs echo .write "<tr><td align=left colspan=4 bgcolor=#698cc2 style='FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'><font style=font-size:15px;color:#ffffff;><b>Installation Mode:</b><input type='radio' CHECKED name='INSTALLMODLE' value='M1' title='Default is ordinary installation mode, can not only install portable software, but also install ordinary software. When installing portable software, no pre-compression is required'>One-Click Ordinary Installation<input type='radio' name='INSTALLMODLE' value='M2' title='Can only install pre-compressed portable software, non-portable software will be ignored'>One-Click Green Installation<input type='radio' name='INSTALLMODLE' value='M3' title='Repair installed portable software, requires GSETUP.bat to exist in the portable software directory'>One-Click Green Repair<input type='radio' name='INSTALLMODLE' value='M4' title='Uninstall installed portable software, requires install.bat to exist in the portable software directory'>One-Click Green Uninstall<br><B>Installation Path:</B><input type='text' ID='IPATH' name='IPATH' SIZE='70'value='D:\GREEN' title='Note that when setting, do not enter the last \ of the path. For example, C: should not be set as C:\, and for example, C:\MYSOFT should not be set as C:\MYSOFT\, and if not set, the default installation path is D:\GREEN'></font></td></tr>"
>>%Temp%\Temp.vbs echo .write "<tr><td align=center width=25%% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'> </td><td align=center width=25%% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'></td>"
>>%Temp%\Temp.vbs echo .write "<td align=center width=25%% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'> </td><td align=center width=25%% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'> </td><tr></table>"
>>%Temp%\Temp.vbs echo .write "<table width=550 align=center border=0 cellSpacing=0 cellpadding=5 ><tr align=center><td align=center width=25%%><input id=btALL type=submit class=button value='Select All' title='Select all or cancel all selection for software installation' style='font-family:楷体_gb2312;font-size:21px;width=100;%button%'></td><td align=center width=25%%><input id=btInstall type=button class=button value='Install Now' title='Install selected software now' style='font-family:楷体_gb2312;font-size:21px;width=100;%button%'></td>"
>>%Temp%\Temp.vbs echo .write "<td align=center width=25%%><input id=btGInStallList type=button class=button value='Make Installation Script' title='Generate InStallList.TXT file in the current directory for installation according to this file, so that software comments can be set freely and installation speed can be improved.' style='font-family:楷体_gb2312;font-size:21px;width=140;%button%'></td><td align=center width=25%%><input type=button class=button onClick='opener=null;window.close()' value='Exit Program' title='Exit installation program' style='font-family:楷体_gb2312;font-size:21px;width=100;%button%'></td></tr></td></table>"
>>%Temp%\Temp.vbs echo .write "</body></html>"
>>%Temp%\Temp.vbs echo end with
>>%Temp%\Temp.vbs echo dim wmi
>>%Temp%\Temp.vbs echo set wnd=ie.document.parentwindow
>>%Temp%\Temp.vbs echo set id=ie.document.all
>>%Temp%\Temp.vbs echo id.btAll.onclick=getref("btALL")
>>%Temp%\Temp.vbs echo id.btInstall.onclick=getref("btInstall")
>>%Temp%\Temp.vbs echo id.btGInStallList.onclick=getref("btGInStallList")
>>%Temp%\Temp.vbs echo do while true
>>%Temp%\Temp.vbs echo wscript.sleep 500
>>%Temp%\Temp.vbs echo WshShell.AppActivate ("One-Click Installation Manager - Microsoft Internet Explorer")
>>%Temp%\Temp.vbs echo loop
REM Exit program button
>>%Temp%\Temp.vbs echo sub event_onquit
>>%Temp%\Temp.vbs echo Wscript.Echo "GOTO END"
>>%Temp%\Temp.vbs echo wscript.quit
>>%Temp%\Temp.vbs echo end sub
REM Select all or not button
>>%Temp%\Temp.vbs echo sub btALL
>>%Temp%\Temp.vbs echo with id
>>%Temp%\Temp.vbs echo if .btALL.value="Select All" then
>>%Temp%\Temp.vbs echo for sx=0 to .InStallList.length-1
>>%Temp%\Temp.vbs echo .InStallList(sx).checked=-1
>>%Temp%\Temp.vbs echo next
>>%Temp%\Temp.vbs echo .btALL.value="Cancel All"
>>%Temp%\Temp.vbs echo elseif .btALL.value="Cancel All" then
>>%Temp%\Temp.vbs echo for sx=0 to .InStallList.length-1
>>%Temp%\Temp.vbs echo .InStallList(sx).checked=0
>>%Temp%\Temp.vbs echo next
>>%Temp%\Temp.vbs echo .btALL.value="Select All"
>>%Temp%\Temp.vbs echo end if
>>%Temp%\Temp.vbs echo end with
>>%Temp%\Temp.vbs echo end sub
REM Make installation script button
>>%Temp%\Temp.vbs echo sub btGInStallList
IF EXIST "InStallList.TXT" >>%Temp%\Temp.vbs echo msg="There is already InStallList.TXT, are you sure you want to overwrite this installation script?"
IF NOT EXIST "InStallList.TXT" >>%Temp%\Temp.vbs echo msg="Making the installation script will exit and restart this program, are you sure?"
>>%Temp%\Temp.vbs echo ie.visible=0
>>%Temp%\Temp.vbs echo IF MsgBox(msg,vbQuestion+vbYesNo,"Little Dot Reminds You")=vbNo then
>>%Temp%\Temp.vbs echo ie.visible=1
>>%Temp%\Temp.vbs echo exit sub
>>%Temp%\Temp.vbs echo END IF
>>%Temp%\Temp.vbs echo Wscript.Echo "GOTO GL"
>>%Temp%\Temp.vbs echo ie.quit
>>%Temp%\Temp.vbs echo end sub
REM Check if the installation path is legal, and if there is no error, return the installation path to CMD
>>%Temp%\Temp.vbs echo sub btInstall
>>%Temp%\Temp.vbs echo ie.visible=0
>>%Temp%\Temp.vbs echo with id
>>%Temp%\Temp.vbs echo if .IPATH.value="" then
>>%Temp%\Temp.vbs echo msgbox "Installation path cannot be empty, please re-enter!",,"Little Dot Reminds You"
>>%Temp%\Temp.vbs echo ie.visible=1
>>%Temp%\Temp.vbs echo exit sub
>>%Temp%\Temp.vbs echo elseif right(.IPATH.value,1)="\" then
>>%Temp%\Temp.vbs echo msgbox "The last character of the installation path cannot be \, please re-enter!",,"Little Dot Reminds You"
>>%Temp%\Temp.vbs echo ie.visible=1
>>%Temp%\Temp.vbs echo exit sub
>>%Temp%\Temp.vbs echo end if
>>%Temp%\Temp.vbs echo Wscript.Echo "SET IPATH="+.IPATH.value
REM Return installation mode to CMD
>>%Temp%\Temp.vbs echo dim mx
>>%Temp%\Temp.vbs echo for mx=0 to 3
>>%Temp%\Temp.vbs echo if .INSTALLMODLE(mx).checked=-1 then
>>%Temp%\Temp.vbs echo Wscript.Echo "GOTO "+.INSTALLMODLE(mx).value
>>%Temp%\Temp.vbs echo if .INSTALLMODLE(mx).value="M3" OR .INSTALLMODLE(mx).value="M4" THEN wscript.quit
>>%Temp%\Temp.vbs echo end if
>>%Temp%\Temp.vbs echo next
REM Check if the software to be installed is selected. If not, exit. Here, it should be noted that when judging whether the object exists, the ON ERROR statement must be used in front, and the full name ie.document.all.InStallList must be used. Although there is ID=ie.document.all in front, here it cannot be referenced using.InStallList
>>%Temp%\Temp.vbs echo on error resume next
>>%Temp%\Temp.vbs echo tt=isobject(ie.document.all.InStallList)
>>%Temp%\Temp.vbs echo if tt=false then
>>%Temp%\Temp.vbs echo ie.visible=0
>>%Temp%\Temp.vbs echo msgbox "No software to be installed is found, please put this program in the directory or parent directory where the software needs to be installed",,"Little Dot Reminds You"
>>%Temp%\Temp.vbs echo ie.visible=1
>>%Temp%\Temp.vbs echo exit sub
>>%Temp%\Temp.vbs echo end if
>>%Temp%\Temp.vbs echo Set objFSO = CreateObject("Scripting.FileSystemObject")
>>%Temp%\Temp.vbs echo Set objInStallList = objFSO.OpenTextFile("%TEMP%\InStallList.ini",2,true)
>>%Temp%\Temp.vbs echo dim sx,nx
>>%Temp%\Temp.vbs echo nx=0
>>%Temp%\Temp.vbs echo for sx=0 to .InStallList.length-1
>>%Temp%\Temp.vbs echo if .InStallList(sx).checked=-1 then
>>%Temp%\Temp.vbs echo nx=nx+1
>>%Temp%\Temp.vbs echo objInStallList.WriteLine .InStallList(sx).value
>>%Temp%\Temp.vbs echo end if
>>%Temp%\Temp.vbs echo next
>>%Temp%\Temp.vbs echo ie.quit
>>%Temp%\Temp.vbs echo end with
>>%Temp%\Temp.vbs echo end sub
REM Get the variables returned by VBS
IF EXIST "%TEMP%\InStallList.ini" SET ISL=%TEMP%\InStallList.ini
IF EXIST "%TEMP%\InStallList.ini" SET ETD=EOL=;TOKENS=1-2 DELIMS=:
for /f "delims=" %%i in ('"cscript //nologo %Temp%\Temp.vbs"') do (CALL %%i)
:M1
REM Install portable software according to any compressed package (only need to have executable GSETUP.BAT file in the compressed package, and call it after extraction):
CLS
IF NOT EXIST "%IPATH%" MD "%IPATH%"
FOR /F "%ETD%" %%I IN (%ISL%) DO (
IF NOT EXIST "%IPATH%\%%~nI" (
SET IPATH=%IPATH%\%%~nI
ECHO Installing %%~nI to %IPATH% now, please wait......
IF /I "%%~xI"==".EXE" (START /WAIT/MIN "" "%%I") ELSE (RAR X -Y -IDQ "%%I" -AD "%IPATH%")
)
)
GOTO :M3
:M2
REM Install portable software according to the pre-determined compressed package (directly specify the pressure path %IPATH% in the EXE compressed package and register to run the software after extraction. The compressed package file name does not need to be in the *G.* format again. For DOS version, it must be in this form to be identified)
CLS
IF NOT EXIST "%IPATH%" MD "%IPATH%"
FOR /F "%ETD%" %%I IN (%ISL%) DO (
IF NOT EXIST "%IPATH%\%%~nI" (
SET IPATH=%IPATH%\%%~nI
ECHO Installing %%~nI to %IPATH% now, please wait......
ECHO %IPATH%
ECHO %%I
PAUSE
START /WAIT/MIN "" "%%I")
)
GOTO :END
:M3
REM One-click green repair according to GSETUP.BAT in the path set by the user. It is recommended to uniformly put the required tools in the TOOLS directory of this program or separately in the GTOOLS directory of the software
CLS
IF NOT EXIST "%IPATH%" GOTO :END
FOR /F "DELIMS=" %%I IN ('DIR /S/B/A %IPATH%\GSETUP.BAT') DO (
PUSHD "%%~dpI"
ECHO Executing %%I now, please wait......
START /WAIT/MIN "" "%%I")
)
REM POPD
GOTO :END
:M4
REM One-click green uninstall according to UINSTALL.BAT in the path set by the user
CLS
IF NOT EXIST "%IPATH%" GOTO :END
FOR /F "DELIMS=" %%I IN ('DIR /S/B/A %IPATH%\UINSTALL.BAT') DO (
PUSHD "%%~dpI"
ECHO Executing %%I now, please wait......
START /WAIT/MIN "" "%%I")
)
REM POPD
GOTO :END
:InStallList
REM Get the installation file list to the IE checkbox. If there are installation files, call directly; otherwise, generate the installation file list. At the same time, set the list of files to be installed according to whether there are compressed comments 1984407iloveyou
CHCP %LAN%>NUL
IF EXIST "InStallList.TXT" (
FOR /F "EOL=;TOKENS=1-2 DELIMS=:" %%I IN (InStallList.TXT) DO (
>>%Temp%\Temp.vbs echo .write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='%%I'><b>%%~nxI</b></td>"
>>%Temp%\Temp.vbs echo .write "<td align=left colspan=3>  %%J</td><tr>"
)
)
IF NOT EXIST "InStallList.TXT" (
FOR /F "DELIMS=" %%I IN ('DIR /S/B/O:N *.EXE *.RAR *.7Z') DO (
>>%Temp%\Temp.vbs echo .write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='%%~nxI'><b>%%~nxI</b></td>"
RAR LT "%%I"|FIND /I "comment:" >NUL
IF ERRORLEVEL 1 (>>%Temp%\Temp.vbs echo .write "<td align=left colspan=3>  </td><tr>")
IF ERRORLEVEL 0 (FOR /F "TOKENS=2 DELIMS=:" %%A IN ('RAR LT "%%I"^|FIND /I "comment:"') DO (>>%Temp%\Temp.vbs echo .write "<td align=left colspan=3> %%A</td><tr>")))
)
goto :eof
:GL
REM Make installation script file
CHCP %LAN%>NUL
>InStallList.TXT ECHO ;Using the installation script can greatly improve the program speed, but when using, please note: do not modify the name of the software, do not remove the English colon between the software name and the description, otherwise installation will not be possible; there should be no colon in the description; there should be no special symbols such as line breaks in the description, otherwise the description will be incomplete when reading.
FOR /F "DELIMS=" %%I IN ('DIR /S/B/O:N *.EXE *.RAR *.7Z') DO (
RAR LT "%%I"|FIND /I "comment:" >NUL
IF ERRORLEVEL 1 (ECHO %%~nXI:>>InStallList.TXT)
IF ERRORLEVEL 0 (FOR /F "TOKENS=2 DELIMS=:" %%A IN ('RAR LT "%%I"^|FIND /I "comment:"') DO (>>InStallList.TXT ECHO %%~nxI:%%A))
)
rem CHCP %LAN%>NUL
IF EXIST InStallList.TXT (SET msg=Successfully created installation script InStallList.TXT, do you want to modify this file now?) ELSE (SET msg=Failed to create installation script InStallList.TXT, do you want to return to the installation interface now?)
>%TEMP%\Temp.vbs Echo intAnswer = MsgBox("%msg%", vbQuestion+vbYesNo, "Little Dot's Warm Tip!")
>>%TEMP%\Temp.vbs Echo IF intAnswer = vbYes THEN
IF EXIST InStallList.TXT (>>%TEMP%\Temp.vbs Echo Wscript.Echo "START InStallList.TXT") ELSE (>>%TEMP%\Temp.vbs Echo Wscript.Echo "START %~nx0")
>>%TEMP%\Temp.vbs Echo ELSEIF intAnswer = vbNo THEN
IF EXIST InStallList.TXT (>>%TEMP%\Temp.vbs Echo Wscript.Echo "START %~nx0") ELSE (>>%TEMP%\Temp.vbs Echo Wscript.Echo "exit")
>>%TEMP%\Temp.vbs Echo END If
for /f "delims=&" %%i in ('"cscript //nologo %Temp%\Temp.vbs"') do (CALL %%i &exit)
:END
REM Exit program and undo the previously minimized all windows (because the environment variables are lost, so all windows will be maximized)
REM >%Temp%\Temp.vbs echo set WshShell = Wscript.CreateObject("Wscript.Shell")
REM >>%Temp%\Temp.vbs echo set minWA= Wscript.CreateObject("Shell.Application")
REM >>%Temp%\Temp.vbs echo minWA.UndoMinimizeALL
REM cscript //nologo "%Temp%\Temp.vbs"
>"%TEMP%\Temp.vbs" Echo intAnswer = MsgBox("Installation or maintenance has been completed, thank you for using, goodbye!" , vbOkOnly, "Little Dot's Warm Tip!")
cscript //nologo "%Temp%\Temp.vbs"
IF EXIST "%TEMP%\Temp.vbs" DEL /F/Q "%TEMP%\Temp.vbs"
IF EXIST "%TEMP%\InStallList.ini" DEL /F/Q "%TEMP%\InStallList.ini"
EXIT
[ Last edited by HUNRYBECKY on 2007-3-10 at 01:44 AM ]
Recent Ratings for This Post
( 5 in total)
Click for details

