仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 341|回复: 9
打印 上一主题 下一主题

[学习教程] ASP网站制作之利用InstallShield制造ASP安装程序

[复制链接]
小妖女 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-16 22:56:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
大家可以自己去看一看.可以说看得想呕吐.以前有次下了个动网来看.里面连基本内置函数的保护措施(函数没防御性)都没有.难怪经常补这个补那个了.可能现在.NET版会好点吧installshield|程序
我如今在做ASP的安装程序,如许能够便利用户的利用。我利用的InstallShield版本是InstallShieldProfessional―StandardEdition6.3。
我没有效过这个东东,成绩以下:

成绩一
经由过程ProjectWizard-generatedscript做好了COPY打包事情。但是6.3版本的好象不撑持主体Program...Endprogram,由于我看COPY打包的Script剧本就是经由过程两个Fuction完成的。以是我的剧本加不出来,除非在这两个Fuction中挪用!叨教是否是6.3版本不克不及利用Program...Endprogram,假如可使用的话,应当怎样往用?
成绩二
想在COPY完ASP程序后间接完成IIS的设置,也就是经由过程安装程序就能够完成,不必要手动设置,叨教如何往完成呢?
以下就是我用ProjectWizard-generatedscript做好的两个Fuction,他们不必挪用也不必声明界说就主动实行,真是弄不懂呀!我的Script该加在甚么中央呢?
//Includeheaderfiles

#include"ifx.h"
functionOnFirstUIBefore()
numbernResult,nSetupType;
stringszTitle,szMsg;
stringszLicenseFile,szQuestion;
stringszName,szCompany,szSerial;
stringszTargetPath;
stringszDir;
stringszComponents,szTargetdir;
numbernLevel;
LISTlistStartCopy;
numbernvSize;
begin
nSetupType=TYPICAL;
TARGETDIR="C:"^"inetpub"^"wwwroot"^@PRODUCT_NAME;
szDir=TARGETDIR;
szName="";
szCompany="";
szSerial="";
Dlg_Start:
//beginningofdialogslabel
Dlg_SdWelcome:
szTitle="";
szMsg="";
nResult=SdWelcome(szTitle,szMsg);
if(nResult=BACK)gotoDlg_Start;
Dlg_SdLicense:
szLicenseFile=SUPPORTDIR^"license.txt";
szTitle="";
szMsg="";
szQuestion="";
nResult=SdLicense(szTitle,szMsg,szQuestion,szLicenseFile);
if(nResult=BACK)gotoDlg_SdWelcome;
Dlg_SdRegisterUserEx:
szMsg="";
szTitle="";
nResult=SdRegisterUserEx(szTitle,szMsg,szName,szCompany,szSerial);
if(nResult=BACK)gotoDlg_SdLicense;
Dlg_SdAskDestPath:
szTitle="";
szMsg="pleaseselectsetupfolder";
nResult=SdAskDestPath(szTitle,szMsg,szDir,0);
TARGETDIR=szDir;
if(nResult=BACK)gotoDlg_SdRegisterUserEx;
Dlg_SetupType:
szTitle="";
szMsg="";
nResult=SetupType(szTitle,szMsg,"",nSetupType,0);
if(nResult=BACK)then
gotoDlg_SdAskDestPath;
else
nSetupType=nResult;
if(nSetupType!=CUSTOM)then
szTargetPath=TARGETDIR;
nvSize=0;
ComponentCompareSizeRequired(MEDIA,szTargetPath,nvSize);
if(nvSize!=0)then
MessageBox(szSdStr_NotEnoughSpace,WARNING);
gotoDlg_SetupType;
endif;
endif;
endif;
Dlg_SdComponentTree:
if((nResult=BACK)&&(nSetupType!=CUSTOM))gotoDlg_SetupType;
szTitle="";
szMsg="";
szTargetdir=TARGETDIR;
szComponents="";
nLevel=2;
if(nSetupType=CUSTOM)then
nResult=SdComponentTree(szTitle,szMsg,szTargetdir,szComponents,nLevel);
if(nResult=BACK)gotoDlg_SetupType;
endif;
Dlg_ObjDialogs:
nResult=ShowObjWizardPages(nResult);
if(nResult=BACK)gotoDlg_SdComponentTree;

Dlg_SdStartCopy:
szTitle="";
szMsg="";
listStartCopy=ListCreate(STRINGLIST);
nResult=SdStartCopy(szTitle,szMsg,listStartCopy);
ListDestroy(listStartCopy);
if(nResult=BACK)gotoDlg_ObjDialogs;
//setupdefaultstatus
SetStatusWindow(0,"");
Enable(STATUSEX);
StatusUpdate(ON,100);
return0;
end;
///////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnMoving
//
//EVENT:Movingeventissentwhenfiletransferisstartedasaresultof
//ComponentTransferDatacall,beforeanyfiletransferoperations
//areperformed.
//
///////////////////////////////////////////////////////////////////////////////
functionOnMoving()
stringszAppPath;
begin
szAppPath=TARGETDIR;
RegDBSetItem(REGDB_APPPATH,szAppPath);
RegDBSetItem(REGDB_APPPATH_DEFAULT,szAppPath^@PRODUCT_KEY);
end;
//---includescriptfilesection---
6.3版好象是用事务驱动的:
//////////////////////////////////////////////////////////////////////////////
//
//函数:OnFirstUIBefore
//
//事务:FirstUIBeforeeventissentwheninstallationisrunforthefirst
//timeongivenmachine.Inthehandlerinstallationusuallydisplays
//UIallowingendusertospecifyinstallationparameters.Afterthis
//functionreturns,ComponentTransferDataiscalledtoperformfile
//transfer.
//
///////////////////////////////////////////////////////////////////////////////
OnFirstUIBefore()是在某台电脑上第一次运转安装时实行.
//////////////////////////////////////////////////////////////////////////////
//
//函数:OnFirstUIAfter
//
//事务:FirstUIAftereventissentafterfiletransfer,wheninstallation
//isrunforthefirsttimeongivenmachine.Inthiseventhandler
//installationusuallydisplaysUIthatwillinformenduserthat
//installationhasbeencompletedsuccessfully.
//
///////////////////////////////////////////////////////////////////////////////
OnFirstUIAfter()在文件复制停止后运转.
上面是创建WEB文件和设置的例子需VBS文件(有假造目次设置,但没有权限设置).

////////////////////////////////////////////////////////////////////////////////
//
//IIIIIIISSSSSS
//IISSInstallShield(R)
//IISSSSSS(c)1996-1999,InstallShieldSoftwareCorporation
//IISS(c)1990-1996,InstallShieldCorporation
//IIIIIIISSSSSSAllRightsReserved.
//
//
//Thiscodeisgeneratedasastartingsetuptemplate.Youshould
//modifyittoprovideallnecessarystepsforyoursetup.
//
//
//文件名:Setup.rul
//
//形貌:InstallShieldscript
//
//正文:Thistemplatescriptperformsabasicsetup.Withminor
//modifications,thistemplatecanbeadaptedtocreate
//new,customizedsetups.
//
////////////////////////////////////////////////////////////////////////////////

//包括的头文件
#include"ifx.h"//不克不及挪动
//////////////////////stringdefines////////////////////////////
////////////////////installationdeclarations///////////////////
//-----DLLfunctionprototypes-----

//yourDLLfunctionprototypes
//----scriptfunctionprototypes-----

//yourscriptfunctionprototypes
prototypeCHK_serial(STRING,STRING);
prototypeRegODBC(STRING);
prototypeset_vod_liveaddress();
//yourglobalvariables
STRINGszvodservername;
STRINGszliveservername;

//////////////////////////////////////////////////////////////////////////////
//
//函数:OnFirstUIBefore
//
//事务:FirstUIBeforeeventissentwheninstallationisrunforthefirst
//timeongivenmachine.Inthehandlerinstallationusuallydisplays
//UIallowingendusertospecifyinstallationparameters.Afterthis
//functionreturns,ComponentTransferDataiscalledtoperformfile
//transfer.
//
///////////////////////////////////////////////////////////////////////////////
functionOnFirstUIBefore()
NUMBERnResult,nSetupType;
STRINGszTitle,szMsg;
STRINGszLicenseFile,szQuestion;
STRINGsvName,svCompany,svSerial;
STRINGszFile;
STRINGszTargetPath;
STRINGszDir;
STRINGszfolder;
STRINGszComponents,szTargetdir;
//zy
STRINGszDefault,svResult;
STRINGsDBSERVERNAME;
OBJECTpiisObj;
//zy
NUMBERnLevel;
LISTlistStartCopy;
LISTlist;
NUMBERnvSize;
STRINGmsg;
begin

//ToDo:ifyouwanttoenablebackground,windowtitle,andcaptionbartitle
//SetTitle(@TITLE_MAIN,24,WHITE);
//SetTitle(@TITLE_CAPTIONBAR,0,BACKGROUNDCAPTION);
//Enable(FULLWINDOWMODE);
//Enable(BACKGROUND);
//SetColor(BACKGROUND,RGB(0,128,128));


nSetupType=TYPICAL;
TARGETDIR="D:"^"cyclone2000";
szDir=TARGETDIR;
SHELL_OBJECT_FOLDER=@FOLDER_NAME;
svName="";
svCompany="";
svSerial="";
Dlg_Start:
//beginningofdialogslabel
Dlg_SdWelcome://接待对话框
szTitle="";
szMsg="";
nResult=SdWelcome(szTitle,szMsg);
if(nResult=BACK)gotoDlg_Start;
Dlg_SdLicense://软件允许协定对话框
szLicenseFile=SUPPORTDIR^"license.txt";
szTitle="";
szMsg="";
szQuestion="";
nResult=SdLicense(szTitle,szMsg,szQuestion,szLicenseFile);
if(nResult=BACK)gotoDlg_SdWelcome;
Dlg_SdShowInfoList://readme文件对话框
szFile=SUPPORTDIR^"infolist.txt";
list=ListCreate(STRINGLIST);
ListReadFromFile(list,szFile);
szTitle="";
szMsg="";
nResult=SdShowInfoList(szTitle,szMsg,list);
ListDestroy(list);
if(nResult=BACK)gotoDlg_SdLicense;
Dlg_SdRegisterUserEx://用户信息对话框
szMsg="";
szTitle="";
nResult=SdRegisterUserEx(szTitle,szMsg,svName,svCompany,svSerial);
if(nResult=BACK)gotoDlg_SdShowInfoList;
//反省序列号
if(CHK_serial(svCompany,svSerial)<0)then
gotoDlg_SdRegisterUserEx;
endif;
//反省序列号终了
Dlg_SdAskDestPath://安装地位对话框
szTitle="";
szMsg="";
nResult=SdAskDestPath(szTitle,szMsg,szDir,0);
TARGETDIR=szDir;
if(nResult=BACK)gotoDlg_SdRegisterUserEx;
Dlg_SetupType://安装范例对话框
szTitle="";
szMsg="";
nResult=SetupType(szTitle,szMsg,"",nSetupType,0);
if(nResult=BACK)then
gotoDlg_SdAskDestPath;
else
nSetupType=nResult;
if(nSetupType!=CUSTOM)then
szTargetPath=TARGETDIR;
nvSize=0;
ComponentCompareSizeRequired(MEDIA,szTargetPath,nvSize);
if(nvSize!=0)then
MessageBox(szSdStr_NotEnoughSpace,WARNING);
gotoDlg_SetupType;
endif;
endif;
endif;
Dlg_SdComponentTree://对话框
if((nResult=BACK)&&(nSetupType!=CUSTOM))gotoDlg_SetupType;
szTitle="";
szMsg="";
szTargetdir=TARGETDIR;
szComponents="";
nLevel=2;
if(nSetupType=CUSTOM)then
nResult=SdComponentTree(szTitle,szMsg,szTargetdir,szComponents,nLevel);
if(nResult=BACK)gotoDlg_SetupType;
endif;
Dlg_SdSelectFolder://对话框
szfolder=SHELL_OBJECT_FOLDER;
szTitle="";
szMsg="";
nResult=SdSelectFolder(szTitle,szMsg,szfolder);
SHELL_OBJECT_FOLDER=szfolder;
if(nResult=BACK)gotoDlg_SdComponentTree;
Dlg_AskText://设置数据库服务器对话框
szTitle="设置数据库服务器";
szMsg="";
szQuestion="请输出SQLSERVER(旋风2000)数据库服务器的主机名或IP地点";
szDefault="192.168.0.1";
SetDialogTitle(DLG_ASK_TEXT,szTitle);
nResult=AskText(szQuestion,szDefault,svResult);
sDBSERVERNAME=svResult;
if(nResult=BACK)gotoDlg_SdSelectFolder;
RegODBC(sDBSERVERNAME);
Dlg_SdStartCopy://入手下手复制文件对话框
szTitle="";
szMsg="";
listStartCopy=ListCreate(STRINGLIST);
//Thefollowingisanexampleofhowtoaddastring(svName)toalist(listStartCopy).
//eg.ListAddString(listStartCopy,svName,AFTER);
nResult=SdStartCopy(szTitle,szMsg,listStartCopy);
ListDestroy(listStartCopy);
if(nResult=BACK)gotoDlg_AskText;
//setupdefaultstatus
SetStatusWindow(0,"");
Enable(STATUSEX);
StatusUpdate(ON,100);
return0;
end;
//////////////////////////////////////////////////////////////////////////////
//
//函数:OnFirstUIAfter
//
//事务:FirstUIAftereventissentafterfiletransfer,wheninstallation
//isrunforthefirsttimeongivenmachine.Inthiseventhandler
//installationusuallydisplaysUIthatwillinformenduserthat
//installationhasbeencompletedsuccessfully.
//
///////////////////////////////////////////////////////////////////////////////
functionOnFirstUIAfter()
STRINGszTitle,szMsg1,szMsg2,szOption1,szOption2,szCmdLine;
NUMBERbOpt1,bOpt2;
begin
szCmdLine=SUPPORTDIR^"mkwebdir.vbs"+"-cLocalHost-w1-vcyclone2000-d"+TARGETDIR;
if(LaunchAppAndWait("WScript.exe",szCmdLine,WAIT)<0)then
MessageBox("不克不及创建WEB假造目次.",SEVERE);
endif;
set_vod_liveaddress();
szCmdLine=SUPPORTDIR^"odbc.reg";
if(LaunchAppAndWait("regedit.exe",szCmdLine,WAIT)<0)then
MessageBox("不克不及设置ODBC.",SEVERE);
endif;
Disable(STATUSEX);
bOpt1=FALSE;
bOpt2=FALSE;
szMsg1=SdLoadString(IFX_SDFINISH_MSG1);
szMsg2="请扫瞄本主机WEB服务器上的cyclone2000假造目次

例:
http://Localhost/cyclone2000/default.htm";
szOption1="";
szOption2="";
szTitle="旋风2000安装完成";
SdFinishEx(szTitle,szMsg1,szMsg2,szOption1,szOption2,bOpt1,bOpt2);
szCmdLine="http://LocalHost/cyclone2000/default.htm";
if(LaunchApp(PROGRAMFILES^"InternetExplorer"^"IEXPLORE.EXE",szCmdLine)<0)then
MessageBox("不克不及翻开扫瞄器.",SEVERE);
endif;
return0;
end;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnMaintUIAfter
//
//EVENT:MaintUIAftereventissentafterfiletransfer,whenenduserruns
//installationthathasalreadybeeninstalledonthemachine.Usually
//thishappensthroughAdd/RemoveProgramsapplet.
//InthehandlerinstallationusuallydisplaysUIthatwillinform
//enduserthatmaintenance/uninstallationhasbeencompletedsuccessfully.
//
///////////////////////////////////////////////////////////////////////////////
functionOnMaintUIAfter()
STRINGszTitle,szMsg1,szMsg2,szOption1,szOption2;
NUMBERbOpt1,bOpt2;
begin
Disable(STATUSEX);
bOpt1=FALSE;
bOpt2=FALSE;
szMsg1=SdLoadString(IFX_SDFINISH_MAINT_MSG1);
szMsg2="";
szOption1="";
szOption2="";
szTitle=SdLoadString(IFX_SDFINISH_MAINT_TITLE);
SdFinishEx(szTitle,szMsg1,szMsg2,szOption1,szOption2,bOpt1,bOpt2);
return0;
end;

///////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnMoving
//
//EVENT:Movingeventissentwhenfiletransferisstartedasaresultof
//ComponentTransferDatacall,beforeanyfiletransferoperations
//areperformed.
//
///////////////////////////////////////////////////////////////////////////////
functionOnMoving()
STRINGszAppPath;
begin
//SetLOGOComplianceApplicationPath
//TODO:ifyourapplication.exeisinasubfolderofTARGETDIRthenaddsubfolder
szAppPath=TARGETDIR;
RegDBSetItem(REGDB_APPPATH,szAppPath);
RegDBSetItem(REGDB_APPPATH_DEFAULT,szAppPath^@PRODUCT_KEY);
end;
//---includescriptfilesection---

functionLoginSQL(szTitle,szSqlsvname,szSqluser,szSqlpassword)
STRINGszDlg,szTemp;
NUMBERbDone,nId,nMessage,nTemp;
INThwndDlg;
HWNDhwndControl;
begin
szDlg="DLG_LoginSQLSV";
//recorddataproducedbythisdialog
if(MODE=SILENTMODE)then
SdMakeName(szAppKey,szDlg,szTitle,nLoginSQL);
SilentReadData(szAppKey,"Result",DATA_NUMBER,szTemp,nId);
if((nId!=BACK)&&(nId!=CANCEL))then
SilentReadData(szAppKey,"szSqlsvname",DATA_STRING,szSqlsvname,nTemp);
SilentReadData(szAppKey,"szSqluser",DATA_STRING,szSqluser,nTemp);
SilentReadData(szAppKey,"szSqlpassword",DATA_STRING,szSqlpassword,nTemp);
endif;
returnnId;
endif;
//ensuregeneralinitializationiscomplete
if(!bSdInit)then
SdInit();
endif;
if(EzDefineDialog(szDlg,"","",DLG_LoginSQLSV)=DLG_ERR)then
return-1;
endif;
//在用户选择尺度按钮行进行轮回
bDone=FALSE;
while(!bDone)
nId=WaitOnDialog(szDlg);//显现对话框
hwndControl=GetDlgItem(hwndDlg,SD_EDIT_SQLSV_NAME);
SetFocus(hwndControl);
switch(nId)
caseDLG_INIT:
CtrlSetText(szDlg,SD_EDIT_SQLSV_NAME,szSqlsvname);
CtrlSetText(szDlg,SD_EDIT_SQLSV_USER,szSqluser);
CtrlSetText(szDlg,SD_EDIT_SQLSV_PASSWORD,szSqlpassword);
hwndDlg=CmdGetHwndDlg(szDlg);
SdGeneralInit(szDlg,hwndDlg,STYLE_NORMAL,szSdProduct);
//Thisfunctionsetsthecaptionforoldstyledialogsor
//setsthetextinthetopbannerareaofwin2kstyledialogs
SdSetDlgTitle(szDlg,hwndDlg,szTitle);
caseSD_EDIT_SQLSV_NAME:
nMessage=CtrlGetSubCommand(szDlg);
if(nMessage=EDITBOX_CHANGE)then
CtrlGetText(szDlg,SD_EDIT_SQLSV_NAME,szSqlsvname);
endif;
caseSD_EDIT_SQLSV_USER:
nMessage=CtrlGetSubCommand(szDlg);
if(nMessage=EDITBOX_CHANGE)then
CtrlGetText(szDlg,SD_EDIT_SQLSV_USER,szSqluser);
endif;
caseSD_EDIT_SQLSV_PASSWORD:
nMessage=CtrlGetSubCommand(szDlg);
if(nMessage=EDITBOX_CHANGE)then
CtrlGetText(szDlg,SD_EDIT_SQLSV_PASSWORD,szSqlpassword);
endif;
caseOK:
nId=NEXT;
bDone=TRUE;
caseBACK:
nId=BACK;
bDone=TRUE;
caseDLG_ERR:
SdError(-1,"SdWelcome");
nId=-1;
bDone=TRUE;
caseDLG_CLOSE:
SdCloseDlg(hwndDlg,nId,bDone);
default:
//checkstandardhandling
if(SdIsStdButton(nId)&&SdDoStdButton(nId))then
bDone=TRUE;
endif;
endswitch;
endwhile;
EndDialog(szDlg);
ReleaseDialog(szDlg);
SdUnInit();
//recorddataproducedbythisdialog
SdMakeName(szAppKey,szDlg,szTitle,nLoginSQL);
SilentWriteData(szAppKey,"szSqlsvname",DATA_STRING,szSqlsvname,0);
SilentWriteData(szAppKey,"szSqluser",DATA_STRING,szSqluser,0);
SilentWriteData(szAppKey,"szSqlpassword",DATA_STRING,szSqlpassword,0);
SilentWriteData(szAppKey,"Result",DATA_NUMBER,"",nId);
returnnId;
end;
functionexeSQLfile(szsqlfilename)
STRINGszCmdLine;
NUMBERnTemp;
begin
szCmdLine=SUPPORTDIR^"osql.exe";
if(LaunchAppAndWait(SUPPORTDIR^"osql.exe",szsqlfilename,WAIT)<0)then
MessageBox("不克不及运转SQL安装文件.",SEVERE);
endif;
end;
functionmodifdbdir()
STRINGszinstallfile;
NUMBERnvResult,nvLineNumber;
STRINGszwindir,svReturnLine;
NUMBERsn,nStartPos;
STRINGsz1,sz2,sznewdir;
NUMBERnTemp;
begin
szinstallfile=TARGETDIR^"installcreatedb.sql";
//交换DB文件的创建路径
while(nvResult!=END_OF_FILE)
nvResult=FileGrep(szinstallfile,"D:cycdata",svReturnLine,nvLineNumber,RESTART);
//FileDeleteLine(szodbcregfile,nvLineNumber,nvLineNumber);
sn=StrLength(svReturnLine);
nStartPos=StrFind(svReturnLine,"D:cycdata");
StrSub(sz1,svReturnLine,0,nStartPos);
StrSub(sz2,svReturnLine,nStartPos+11,sn-nStartPos-11);
sznewdir=sz1+TARGETDIR^sz2;
FileInsertLine(szinstallfile,sznewdir,nvLineNumber,REPLACE);
sz1="";
sz2="";
sznewdir="";
endwhile;
end;
//////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnFileReadOnly
//
//EVENT:FileReadOnlyeventissentduringfiletransferwhenaread-only
//fileisneedstobeoverwrittenorremoved.
//
//ARGUMENTS:File-fullpathoffilethatismarkedasread-only.
//
//RETURN:ERR_YES-thefileshouldbeoverwrittenorremoved.
//ERR_NO-thefileshouldnotbemodified.
//
///////////////////////////////////////////////////////////////////////////////
functionOnFileReadOnly(File)
begin
returnSdExceptions(READONLY,File);
end;
//////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnFileReadOnly
//
//EVENT:FileReadOnlyeventissentduringfiletransferwhenaread-only
//fileisneedstobeoverwrittenorremoved.
//
//ARGUMENTS:File-fullpathoffilethatismarkedasread-only.
//
//RETURN:ERR_YES-thefileshouldbeoverwrittenorremoved.
//ERR_NO-thefileshouldnotbemodified.
//
////////////////////////////////////////////////////////////////////////////////
//
//IIIIIIISSSSSS
//IISSInstallShield(R)
//IISSSSSS(c)1996-1999,InstallShieldSoftwareCorporation
//IISS(c)1990-1996,InstallShieldCorporation
//IIIIIIISSSSSSAllRightsReserved.
//
//
//Thiscodeisgeneratedasastartingsetuptemplate.Youshould
//modifyittoprovideallnecessarystepsforyoursetup.
//
//
//FileName:Setup.rul
//
//Description:InstallShieldscript
//
//Comments:Thistemplatescriptperformsabasicsetup.Withminor
//modifications,thistemplatecanbeadaptedtocreate
//new,customizedsetups.
//
////////////////////////////////////////////////////////////////////////////////


//Includeheaderfiles

#include"ifx.h"//DONOTREMOVE

//////////////////////stringdefines////////////////////////////
////////////////////installationdeclarations///////////////////
//-----DLLfunctionprototypes-----

//yourDLLfunctionprototypes

//----scriptfunctionprototypes-----

//yourscriptfunctionprototypes
//yourglobalvariables

//////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnFirstUIBefore
//
//EVENT:FirstUIBeforeeventissentwheninstallationisrunforthefirst
//timeongivenmachine.Inthehandlerinstallationusuallydisplays
//UIallowingendusertospecifyinstallationparameters.Afterthis
//functionreturns,ComponentTransferDataiscalledtoperformfile
//transfer.
//
///////////////////////////////////////////////////////////////////////////////
functionOnFirstUIBefore()
NUMBERnResult,nSetupType;
STRINGszTitle,szMsg;
STRINGszLicenseFile,szQuestion;
STRINGsvName,svCompany,svSerial;
STRINGszDir;
STRINGszfolder;
STRINGszComponents,szTargetdir;
NUMBERnLevel;
begin

//ToDo:ifyouwanttoenablebackground,windowtitle,andcaptionbartitle
//SetTitle(@TITLE_MAIN,24,WHITE);
//SetTitle(@TITLE_CAPTIONBAR,0,BACKGROUNDCAPTION);
//Enable(FULLWINDOWMODE);
//Enable(BACKGROUND);
//SetColor(BACKGROUND,RGB(0,128,128));

//默许值设定
TARGETDIR="C:InetpubwwwrootWebApp";
szDir=TARGETDIR;
SHELL_OBJECT_FOLDER=@FOLDER_NAME;
svName="Daniel";
svCompany="N/A";
svSerial="111-1111111";
Dlg_Start:
//beginningofdialogslabel
Dlg_SdWelcome:
szTitle="";
szMsg="";
nResult=SdWelcome(szTitle,szMsg);
if(nResult=BACK)gotoDlg_Start;
Dlg_SdLicense:
szLicenseFile=SUPPORTDIR^"license.txt";
szTitle="";
szMsg="";
szQuestion="";
nResult=SdLicense(szTitle,szMsg,szQuestion,szLicenseFile);
if(nResult=BACK)gotoDlg_SdWelcome;
Dlg_SdRegisterUserEx:
szMsg="";
szTitle="";
nResult=SdRegisterUserEx(szTitle,szMsg,svName,svCompany,svSerial);
//考证序列号
if(svSerial!="111-1111111")then
MessageBox("InValidSerial!",WARNING);
gotoDlg_SdRegisterUserEx;
endif;
if(nResult=BACK)gotoDlg_SdLicense;
Dlg_SdAskDestPath:
szTitle="";
szMsg="";
nResult=SdAskDestPath(szTitle,szMsg,szDir,0);
TARGETDIR=szDir;
if(nResult=BACK)gotoDlg_SdRegisterUserEx;
Dlg_SdComponentTree:
if((nResult=BACK)&&(nSetupType!=CUSTOM))gotoDlg_SdAskDestPath;
szTitle="";
szMsg="";
szTargetdir=TARGETDIR;
szComponents="";
nLevel=2;
if(nSetupType=CUSTOM)then
nResult=SdComponentTree(szTitle,szMsg,szTargetdir,szComponents,nLevel);
if(nResult=BACK)gotoDlg_SdAskDestPath;
endif;
Dlg_SdSelectFolder:
szfolder=SHELL_OBJECT_FOLDER;
szTitle="";
szMsg="";
nResult=SdSelectFolder(szTitle,szMsg,szfolder);
SHELL_OBJECT_FOLDER=szfolder;
if(nResult=BACK)gotoDlg_SdComponentTree;


//setupdefaultstatus
SetStatusWindow(0,"");
Enable(STATUSEX);
StatusUpdate(ON,100);
return0;
end;
//////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnFirstUIAfter
//
//EVENT:FirstUIAftereventissentafterfiletransfer,wheninstallation
//isrunforthefirsttimeongivenmachine.Inthiseventhandler
//installationusuallydisplaysUIthatwillinformenduserthat
//installationhasbeencompletedsuccessfully.
//
///////////////////////////////////////////////////////////////////////////////
functionOnFirstUIAfter()
STRINGszTitle,szMsg1,szMsg2,szOption1,szOption2,szCmdLine;
NUMBERbOpt1,bOpt2;
begin
szCmdLine=TARGETDIR^"mkwebdir.vbs"+"-clocalhost-w1-vWebApp,"+TARGETDIR;
if(LaunchAppAndWait("WScript.exe",szCmdLine,WAIT)<0)then
MessageBox("不克不及创建WEB假造目次.",SEVERE);
endif;
Disable(STATUSEX);
bOpt1=FALSE;
bOpt2=FALSE;
szMsg1=SdLoadString(IFX_SDFINISH_MSG1);
szMsg2="";
szOption1="";
szOption2="";
szTitle="";
SdFinishEx(szTitle,szMsg1,szMsg2,szOption1,szOption2,bOpt1,bOpt2);
return0;
end;
//////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnMaintUIBefore
//
//EVENT:MaintUIBeforeeventissentwhenenduserrunsinstallationthat
//hasalreadybeeninstalledonthemachine.Usuallythishappens
//throughAdd/RemoveProgramsapplet.Inthehandlerinstallation
//usuallydisplaysUIallowingendusertomodifyexistinginstallation
//oruninstallapplication.Afterthisfunctionreturns,
//ComponentTransferDataiscalledtoperformfiletransfer.
//
///////////////////////////////////////////////////////////////////////////////
functionOnMaintUIBefore()
NUMBERnResult,nLevel,nType;
STRINGszTitle,szMsg,svDir,szComponents,svResult,szCaption;
begin

//ToDo:ifyouwanttoenablebackground,windowtitle,andcaptionbartitle
//SetTitle(@TITLE_MAIN,24,WHITE);
//SetTitle(@TITLE_CAPTIONBAR,0,BACKGROUNDCAPTION);
//SetColor(BACKGROUND,RGB(0,128,128));
//Enable(FULLWINDOWMODE);
//Enable(BACKGROUND);
nType=MODIFY;
Dlg_Start:
Disable(BACKBUTTON);
nResult=SdWelcomeMaint(szTitle,szMsg,nType);
Enable(BACKBUTTON);
Dlg_SdComponentTree:
if(nResult=MODIFY)then
szTitle="";
szMsg="";
svDir=TARGETDIR;
szComponents="";
nLevel=2;
nResult=SdComponentTree(szTitle,szMsg,svDir,szComponents,nLevel);
if(nResult=BACK)gotoDlg_Start;
//setupdefaultstatus
SetStatusWindow(0,"");
Enable(STATUSEX);
StatusUpdate(ON,100);
elseif(nResult=REMOVEALL)then
svResult=SdLoadString(IFX_MAINTUI_MSG);
szCaption=SdLoadString(IFX_ONMAINTUI_CAPTION);
nResult=SprintfBox(MB_OKCANCEL,szCaption,"%s",svResult);
if(nResult=IDCANCEL)then
gotoDlg_Start;
elseif(nResult=IDOK)then
//setupdefaultstatus
SetStatusWindow(0,"");
Enable(STATUSEX);
StatusUpdate(ON,100);
//-->Removeallcomponents
ComponentRemoveAll();
endif;
elseif(nResult=REPAIR)then
//setupdefaultstatus
SetStatusWindow(0,"");
Enable(STATUSEX);
StatusUpdate(ON,100);
//-->ReinstallLoggedComponents
ComponentReinstall();
endif;
end;

///////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnMaintUIAfter
//
//EVENT:MaintUIAftereventissentafterfiletransfer,whenenduserruns
//installationthathasalreadybeeninstalledonthemachine.Usually
//thishappensthroughAdd/RemoveProgramsapplet.
//InthehandlerinstallationusuallydisplaysUIthatwillinform
//enduserthatmaintenance/uninstallationhasbeencompletedsuccessfully.
//
///////////////////////////////////////////////////////////////////////////////
functionOnMaintUIAfter()
STRINGszTitle,szMsg1,szMsg2,szOption1,szOption2;
NUMBERbOpt1,bOpt2;
begin
Disable(STATUSEX);
bOpt1=FALSE;
bOpt2=FALSE;
szMsg1=SdLoadString(IFX_SDFINISH_MAINT_MSG1);
szMsg2="";
szOption1="";
szOption2="";
szTitle=SdLoadString(IFX_SDFINISH_MAINT_TITLE);
SdFinishEx(szTitle,szMsg1,szMsg2,szOption1,szOption2,bOpt1,bOpt2);
return0;
end;
///////////////////////////////////////////////////////////////////////////////
//
//FUNCTION:OnMoving
//
//EVENT:Movingeventissentwhenfiletransferisstartedasaresultof
//ComponentTransferDatacall,beforeanyfiletransferoperations
//areperformed.
//
///////////////////////////////////////////////////////////////////////////////
functionOnMoving()
STRINGszAppPath;
begin
//SetLOGOComplianceApplicationPath
//TODO:ifyourapplication.exeisinasubfolderofTARGETDIRthenaddsubfolder
szAppPath=TARGETDIR;
RegDBSetItem(REGDB_APPPATH,szAppPath);
RegDBSetItem(REGDB_APPPATH_DEFAULT,szAppPath^@PRODUCT_KEY);
end;
//---includescriptfilesection---


asp可以轻松地实现对页面内容的动态控制,根据不同的浏览者,显示不同的页面内容。而浏览者一点觉察不出来,就像为他专门制作的页面一样。使用各种各样的组件,asp可以完成无比强大的功能。
蒙在股里 该用户已被删除
沙发
发表于 2015-1-25 12:39:53 | 只看该作者
先学习用frontpage熟悉html编辑然后学习asp和vbscript建议买书进行系统学习
若相依 该用户已被删除
板凳
发表于 2015-1-25 12:54:34 来自手机 | 只看该作者
运用经典的例子。并且自己可以用他来实现一些简单的系统。如果可以对他进行进一步的修改,找出你觉得可以提高性能的地方,加上自己的设计,那就更上一个层次了,也就会真正地感到有所收获。
飘飘悠悠 该用户已被删除
地板
发表于 2015-2-2 22:09:21 | 只看该作者
作为IE上广为流传的动态网页开发技术,ASP以它简单易学博得了广大WEB程序爱好这的青睐,而且它对运行环境和开发品台的不挑剔,以及有大量有效的参考手册,极大的推广了它的发展。
小妖女 该用户已被删除
5#
 楼主| 发表于 2015-2-8 11:46:30 | 只看该作者
ASP的语言不仅仅只是命令格式差不多,而是包含在<%%>之内的命令完全就是VB语法。虽然ASP也是做为单独的一个技术来提出的,但他就是完全继承了VB所有的功能。
愤怒的大鸟 该用户已被删除
6#
发表于 2015-2-25 10:46:35 | 只看该作者
掌握asp的特性而且一定要知道为什么。
精灵巫婆 该用户已被删除
7#
发表于 2015-3-7 20:01:11 | 只看该作者
不是很难但是英文要有一点基础网上的教程很少有系统的详细的去买书吧,另不用专门学习vb关于vbscript脚本在asp教材都有介绍
海妖 该用户已被删除
8#
发表于 2015-3-15 12:57:49 | 只看该作者
学习ASP其实应该上升到如何学习程序设计这种境界,其实学习程序设计又是接受一种编程思想。比如ASP如何学习,你也许在以前的学习中碰到过。以下我仔细给你说几点:
透明 该用户已被删除
9#
发表于 2015-3-22 01:09:26 | 只看该作者
没有坚实的理论做基础,那么我们连踏入社会第一步的资本都没有,特别对于计算机专业的学生学好专业知识是置关重要的。在这里我侧重讲一下如何学习ASP,从平时的学习过程中。
金色的骷髅 该用户已被删除
10#
发表于 2015-3-22 01:09:29 | 只看该作者
另外因为asp需要使用组件,所以了解一点组件的知识(ADODB也是组件)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-12-24 10:38

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表