二.InstallShield
要使用靜默安裝的方式安裝用InstallShield技術(shù)打包的程序
你首先要在現(xiàn)有的操作系統(tǒng)中創(chuàng)建一個setup.iss文件。
1. 在命令行窗口中使用 -R 參數(shù)(大小寫敏感)運行安裝程序。
例如:
Setup.exe -R
2. 接著會顯示常見的安裝屏幕,并且詢問你一些問題,例如要安裝的目錄等
有一點是很重要的,在安裝結(jié)束后你不能選擇“立刻重啟動計算機”的選項
如果你選了,在批處理文件中的其他命令就會因為計算機重啟動而無法執(zhí)行
3. 在安裝程序運行完畢后,打開你的C:Windows (或者C:WINNT)目錄
然后找到setup.iss文件,把這個文件和你將要靜默安裝的程序setup.exe保存在同一個目錄中
4. 用以下命令進行靜默安裝:
start /wait %systemdrive%installApplicationApplication_nameSetup.exe -s
5. 對所有準備進行靜默安裝,并且使用了InstallShield技術(shù)打包的程序重復(fù)上面的步驟操作
技術(shù)難點:從光盤上的RunOnceEx中安裝用Installshield技術(shù)打包的程序
如果從光盤上直接執(zhí)行RunOnceEx,用Installshield打包的應(yīng)用程序安裝將會失敗
除非你指定了用于保存日至文件的位置
下面就有一個示例,你可以將這個例子用于你自己的程序的安裝(粗體字部分看仔細了):
REG ADD %KEY%45 /VE /D "Kerio Personal Firewall 2.1.5" /f
REG ADD %KEY%45 /V 1 /D "%CDROM%appsKPFSetup.exe -s -f2"%systemdrive%kerio.log"" /f
然后你可以用一個cleanup.cmd文件刪除kerio.log文件
DEL "%systemroot%kerio.log"
我怎么知道哪個程序是使用InstallShield技術(shù)打包的?
大部分這類程序的安裝文件都可以被壓縮軟件解壓縮,安裝文件setup.exe的屬性對話框中應(yīng)該有“InstallShield (R) Setup Launcher”或者
其他類似的字樣。
最后,如果你在保存安裝文件的文件夾中看到了一個setup.iss文件,
那么毫無疑問這是用InstallShield打包了!
QUOTE:
三. Nullsoft SuperPiMP Install System (NSIS)
使用NSIS 打包的安裝文件可以用 /S參數(shù)進行自動安裝(“S”是大小寫敏感的):
Setup.exe /S
你也可以用 /D參數(shù)選擇將要安裝的目標分區(qū)和文件夾:
Setup.exe /S /D=E:SoftwareCDex
像Winamp 和CDex這類的軟件都會在安裝結(jié)束后顯示一個確認屏幕(CDex)
或者一個設(shè)置文件關(guān)聯(lián)方式的結(jié)束安裝屏幕(Winamp)
我還不知道怎樣跳過這一步,但是這個屏幕對批處理文件的繼續(xù)執(zhí)行不會有任何影響
我怎么知道哪個程序是使用NSIS技術(shù)打包的?
很多用NSIS打包的程序在安裝的時候都有類似這樣的窗口,例如Winamp 和CDex:
QUOTE:
四.Microsoft Windows Installer
微軟老大的封包形式!
如果某個軟件是用Windows Installer打包的,那你就應(yīng)該能在文件夾中看到*.msi文件。
這是最典型的特征
這些文件通?梢允褂 /QB和 /QN參數(shù)進行自動安裝。
Powertoys使用了 /s /v/qn參數(shù),對于這些軟件,你可以依次嘗試上面提到的參數(shù)
看看哪個是有效的。
/qb 會在窗口中顯示一個基本的安裝進程
/qn 參數(shù)則不會顯示任何窗口,直接在后臺自動安裝
阻止程序安裝完成后自動重啟動:
為了阻止某些程序安裝成功后自動重啟動(例如Kerio Personal Firewall 4),你可以在 /qn 或者 /qb參數(shù)后使用REBOOT=Suppress標記,例
如:
setup.msi "/qn REBOOT=Suppress"
有些安裝程序使用 /s/v/qn參數(shù)進行自動安裝,因此阻止它們重啟動應(yīng)該用:
setup.exe /s /v"/qn REBOOT=Suppress"
QUOTE:
五.WISE Installer
用WISE技術(shù)打包的軟件在安裝的時候可以選擇使用 /s參數(shù)進行自動安裝:
Setup.exe /s
更多的其他參數(shù):
You can run Wise Installation .EXE with command line options to automate many of the tasks you would normally do in the User
Interface. The list of options is as follows.
/c file.wse -- creates executable file from wise script
/r -- opens Wise in SetupCapture window
/u -- runs the upgrade wizard that checks for any upgrades online
/d CompVar=Value -- defines a single compiler variable in Enterprise Edition. Multiple definitions require multiple /d
/d=filename -- uses filename to define compiler variables. Each line in file is CompVar=Value
Example: installbuilder.exe /c /d _MYVAR_="Test" c:mysourcefilessetup.wse
Wise Installations:
/T -- test mode
/X pathname -- extracts files into pathname
/Z pathname -- extracts files into pathname and reboots
/S -- silent install
/M -- prompts for windows, system, temp directories
/M=filename -- specifies a value file similar to /d above, but for standard variables (See NOTE below).
/M1 -- same as /m plus it prompts before any file that is self-registered
/M2 -- reserved for internal use by Wise during debugger sessions
Example: setup.exe /T
Unwise:
/Z -- remove empty directories, including one with unwise itself in it.
/A -- automatic mode, no user choices other than cancel.
/S -- silent mode, automatic mode with no user choices
/R -- rollback mode, selects option to rollback on uninstall
/U -- like automatic mode, but gives all choices other than custom/automatic title window title can be at the end of the
command line
Example: unwise.exe /S c:myprogramdirectoryinstall.log
NOTE: The values file is a simple text file with variables listed, one per line, in VARIABLE="VALUE" format. If the variable
is found in the values file, the specified value is used; otherwise, its value is unchanged. The file containing the
variables can be up to 32K.
我怎么知道哪些程序是使用Wise技術(shù)打包的?
使用Wise技術(shù)打包的大部分程序都會在開始運行的時候顯示一個啟動界面:
但是也有一些會最小化這個窗口,只顯示一個深藍色的背景,還有安裝窗口在屏幕的中央
基本介紹完畢
有人問?綠色軟件怎么安裝?
告訴大家:用RAR做個自解壓,這個方法好像是最簡單有效的,呵呵