installshield2008使用心得(打包web工程) 收藏
1.新建installscript project
2.在project assistant 檢視中填寫project的基本資訊和檔案及資料夾
3.installscript介紹()語法類似c;
//以下的那些彈出視窗都可以在user inte***ce -->dialog中找到.可以修改.
//user inte***ce 下skin可改安裝程式**
#include "ifx.h"
function onfirstuibefore()//執行安裝程式的第乙個視窗時執行
number nresult, nlevel, nsize, nsetuptype;
string sztitle, szmsg, szopt1, szopt2, szlicensefile;
string szname, szcompany, sztargetpath, szdir, szfeatures;
bool blicenseaccepted;
begin
nsetuptype = complete;
szdir = targetdir;
szname = "";
szcompany = "";
blicenseaccepted = false;
// beginning of ui sequence
dlg_start:
nresult = 0;
dlg_sdwelcome:
sztitle = "";
szmsg = "";
//}is_script_tag(dlg_sdwelcome)
if (nresult = back) goto dlg_start;
dlg_sdlicense2:
sztitle = "";
szopt1 = "";
szopt2 = "";
//}is_script_tag(license_file_path)
//}is_script_tag(dlg_sdlicense2)
if (nresult = back) then
goto dlg_sdwelcome;
else
blicenseaccepted = true;
endif;
dlg_sdregisteruser:
szmsg = "";
sztitle = "";
//}is_script_tag(dlg_sdregisteruser)
if (nresult = back) goto dlg_sdlicense2;
dlg_setuptype2:
sztitle = "";
szmsg = "";
nresult = custom;
//}is_script_tag(dlg_setuptype2)
if (nresult = back) then
goto dlg_sdlicense2;
else
nsetuptype = nresult;
if (nsetuptype != custom) then
sztargetpath = targetdir;
nsize = 0;
featurecomparesizerequired( media, sztargetpath, nsize );
if (nsize != 0) then
messagebox( szsdstr_notenoughspace, warning );
goto dlg_setuptype2;
endif;
endif;
endif;
dlg_sdaskdestpath2:
if ((nresult = back) && (nsetuptype != custom)) goto dlg_setuptype2;
sztitle = "";
szmsg = "";
if (nsetuptype = custom) then
//}is_script_tag(dlg_sdaskdestpath2)
targetdir = szdir;
endif;
if (nresult = back) goto dlg_sdlicense2;
dlg_sdfeaturetree:
if ((nresult = back) && (nsetuptype != custom)) goto dlg_sdaskdestpath2;
sztitle = "";
szmsg = "";
szfeatures = "";
nlevel = 2;
if (nsetuptype = custom) then
//}is_script_tag(dlg_sdfeaturetree)
if (nresult = back) goto dlg_sdaskdestpath2;
endif;
dlg_sqlserver:
nresult = onsqlserverinitialize( nresult );
if( nresult = back ) goto dlg_sdfeaturetree;
dlg_objdialogs:
nresult = showobjwizardpages( nresult );
if (nresult = back) goto dlg_sqlserver;
dlg_sdstartcopy2:
sztitle = "";
szmsg = "";
//}is_script_tag(dlg_sdstartcopy2)
if (nresult = back) goto dlg_objdialogs;
export prototype defaultfeature_installed();
function defaultfeature_installed()
string myinifile,basedir,datadir;
string tomcatstart,mysqlstart;
string basepath,temp;
number nsize,i;
begin
//設定mysql的my.ini配置檔案的要根目錄
//替換\\成/
basepath = targetdir;
strremovelastslash(basepath);
nsize = strlength(basepath);
i=0;
while (i < nsize)
if (basepath[i] = "\\") then
basepath[i] = "/";
endif;
i = i + 1;
endwhile;
//處理完\\成/
myinifile=basepath+"/mysql5/my.ini";
basedir= "basedir=\""+basepath+"/mysql5/\"";
datadir="datadir=\""+basepath+"/mysql5/data/\"";
fileinsertline (myinifile,datadir , 80, before);
fileinsertline (myinifile,basedir , 80, before);
end;
4.新增uninstall快捷方式鬱悶了n久.
其實installshield本身已經自帶uninstall程式.在你安裝自己打包的程式時installshield會在c:\program files\下建立乙個installshield installation information資料夾,下面再有乙個的資料夾.de407beb-f8ad-475f-ab69-73590c37d34f是你程式的guid 在general information-->product property-->product guid可以看到..此資料夾下面有反安裝程式.只要在setup動行的時候加乙個 -uninst的引數就變成了解除安裝程式
知道這個就好辦了.新增乙個快捷方式.把路徑指(target)定為\installshield installation information\\setup.exe,de407beb-f8ad-475f-ab69-73590c37d34f是你的guid 自己手動替換一下.改一下arguments引數為:/uninst
InstallShield系統變數
batch install 指示當傳輸檔案採用lockedfile或sharedfile時是否鎖定檔案 cmdline setup.exe傳遞的命令列引數 commonfiles common files全路徑如 c program file common files errorfilename f...
手寫installshield入門
進入installation designer 視窗 點選左邊樹導航中的 installscript 要使用 installshild自帶的嚮導視窗 必須先 新增兩個標頭檔案 include ifx.h include sddialog.h 定義變數 必須在 program 與endprogram之...
InstallShield 呼叫自編 DLL 示範
installshield 指令碼呼叫 dll 示範 int nresult 定義函式 來自 loaddriver 的 setupload 函式有兩個字串引數 prototype stdcall int loaddriver.setupload string,string 指定 dll 檔案的位置 ...