//===========================================================================
//
// File Name: Setup.rul
//
// Description: Blank setup main script file
//
// Comments: Blank setup is an empty setup project. If you want to
// create a new project via. step-by step instructions use the
// Project Assistant.
//
//===========================================================================
// Included header files ----------------------------------------------------
#include "ifx.h"
#define Emty "" //宏定義DOS功能把Emty 替換爲""
#define SOFTNAME "webbk"
prototype RegUnInstall(STRING);
string szDir, szVirtual;
prototype void CheckRequirements(); //檢測系統必備.net和iis
prototype void CreateVirtualDir(STRING,string);//創建虛擬目錄 參數1虛擬目錄名 參數2物理路徑
function OnFirstUIBefore()
number nResult,nSetupType;
string szName, szCompany;
string szTargetPath;
string szTargetdir;
number nLevel;
LIST listStartCopy;
number nvSize;
begin
nSetupType = TYPICAL; //默認安裝類型
CheckRequirements();
Dlg_SdWelcome:
SetTitle (@TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION);
nResult = SdWelcome( "歡迎使用材料輔助設計軟件安裝嚮導","以下將在你的計算機上安裝材料輔助設計軟件,若要繼續安裝,請點擊下一步......" );
Dlg_SdLicense:
nResult= SdLicense( Emty, Emty, Emty, SUPPORTDIR ^ "license.rtf" );
if (nResult = BACK) goto Dlg_SdWelcome;
Dlg_SdRegisterUserEx:
nResult = SdRegisterUser( Emty, Emty, szName, szCompany );
if (nResult = BACK) goto Dlg_SdLicense;
Dlg_SdAskDestPath:
TARGETDIR = PROGRAMFILES^SOFTNAME;
szDir = TARGETDIR;
nResult = AskDestPath( Emty, Emty, szDir,0 );
TARGETDIR = szDir;
if (nResult = BACK) goto Dlg_SdRegisterUserEx;
Dlg_AskVitualDir :
szVirtual=@PRODUCT_NAME;
SetDialogTitle(DLG_ASK_TEXT,Emty);
nResult=SdShowDlgEdit1 ("設置虛擬目錄", "請輸入虛擬目錄名,安裝程序將設置IIS信息服務./n如果您沒有填寫,安裝程序將按默認方式創建!","虛擬目錄名稱:",szVirtual);
if (nResult = BACK) goto Dlg_SdAskDestPath;
Dlg_SdStartCopy:
if (szVirtual = "") then
MessageBox ("請輸入虛擬目錄的名稱!",INFORMATION) ;
goto Dlg_AskVitualDir;
endif;
listStartCopy = ListCreate( STRINGLIST );
ListAddString(listStartCopy,"用戶名:"+szName,AFTER);
ListAddString(listStartCopy,"公司名稱:"+szCompany,AFTER);
ListAddString(listStartCopy,"目標目錄:"+szDir,AFTER);
ListAddString(listStartCopy,"虛擬目錄:"+szVirtual,AFTER);
ListAddString(listStartCopy,"請確認您填寫的信息,按下一步開始複製文件",AFTER);
nResult = SdStartCopy( "", "", listStartCopy );
ListDestroy(listStartCopy);
if (nResult = BACK) goto Dlg_SdAskDestPath;
SetStatusWindow(0, "");
Enable(STATUSEX);
StatusUpdate(ON, 100);
return 0;
end;
function OnMoving()
string szAppPath;
begin
// RegUnInstall("");
// szAppPath = TARGETDIR;
// RegDBSetItem(REGDB_APPPATH, szAppPath);
// RegDBSetItem(REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY);
end;
function void CheckRequirements()
begin
SdShowMsg ("安裝程序正在檢測系統必備組件......",TRUE);
Delay(1);
SdShowMsg (Emty,FALSE);
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
if (RegDBKeyExist ("System//CurrentControlSet//Services//matlabserver" ) != 1) then
if(SprintfBox(MB_OK,"檢測系統環境","你的計算機沒有被安裝matlabserver,請安裝後重試,安裝程序將退出!")=IDOK)
then exit;
endif;
endif;
if (RegDBKeyExist ("System//CurrentControlSet//Services//IISADMIN" ) != 1) then
if(SprintfBox(MB_OK,"檢測系統環境","你的計算機沒有被安裝IIS,請安裝後重試,安裝程序將退出!")=IDOK)
then exit;
endif;
endif;
if (RegDBKeyExist ("SOFTWARE//Microsoft//.NETFramework//policy//v2.0" ) != 1) then
if(LaunchAppAndWait ( SUPPORTDIR ^"dotnetfx.exe" , "/q:a/l" ,WAIT)<0) then
SprintfBox(MB_OK,".NET安裝","安裝.net框架時發生意外,請重新安裝!");
endif;
endif;
//註冊aspnet服務
//開取matlab web server 服務
end;
function void CreateVirtualDir(VirtualFolder, szDir)
begin
if (VirtualFolder = "") then
MessageBox ("請輸入虛擬目錄的名稱!",INFORMATION) ;
else
SdShowMsg (" 正在創建虛擬目錄"+VirtualFolder+"請不要關閉....", TRUE);
Delay(1);
LaunchAppAndWait(SUPPORTDIR^"Create.exe", VirtualFolder+" /""+TARGETDIR+"/" ",WAIT);
//AddFolderIcon (FOLDER_DESKTOP , "愛普管理系統" ,"http://localhost"^VirtualFolder^"Default.aspx" ,Emty, Emty, 0, Emty, REPLACE|RUN_MINIMIZED);
//這裏不知道爲什麼 只要創建快捷方式就很卡 得等待很久
//AddFolderIcon ( FOLDER_PROGRAMS , "愛普管理系統" ,"http://localhost"^VirtualFolder^"Default.aspx" ,Emty, Emty, 0, Emty, REPLACE|RUN_MINIMIZED);
SdShowMsg (Emty,FALSE);
endif;
end;
function OnFirstUIAfter()
NUMBER bOpt1, bOpt2,nResult, nDefOptions;
begin
Disable(STATUSEX);
CreateVirtualDir(szVirtual, szDir);//這裏會出現Dos窗口
if (!BATCH_INSTALL) then
bOpt1 = FALSE;
bOpt2 = TRUE;
nResult = SdFinish( "安裝完成","已經成功安裝系統,單擊完成以退出安裝嚮導", Emty, "閱讀Readme文件", "立刻運行程序", bOpt1, bOpt2 );
if bOpt1 = TRUE then
CopyFile (SUPPORTDIR^"Readme.txt" , "Readme.txt" );
LaunchApp ( WINDIR^"Notepad.exe" , TARGETDIR^"Readme.txt" );
endif;
if bOpt2=TRUE then
LaunchAppAndWait(SUPPORTDIR^"IEXPLORE.EXE","localhost"^szVirtual^"login.aspx",NOWAIT) ;
endif;
return 0;
endif;
end;
function OnMaintUIAfter()
STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
NUMBER bOpt1, bOpt2;
begin
Disable(STATUSEX);
ShowObjWizardPages(NEXT);
bOpt1 = FALSE;
bOpt2 = FALSE;
szMsg1 = SdLoadString(IFX_SDFINISH_MAINT_MSG1);
szTitle = SdLoadString(IFX_SDFINISH_MAINT_TITLE);
SdFinishEx(szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2);
end;
IIS 自動配置
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.