使用InstallShield製作ASP安裝程式(1)

來源:互聯網
上載者:User
我現在在做ASP的安裝程式,這樣可以方便使用者的使用。我使用的InstallShield版本是InstallShield Professional—Standard Edition6.3。
  我沒有用過這個東東,問題如下:

問題一
  通過Project Wizard-generated script 做好了COPY打包工作。可是6.3版本的好象不支援主體Program...Endprogram,因為我看COPY打包的Script指令碼就是通過兩個Fuction實現的。所以我的指令碼加不進去,除非在這兩個Fuction中調用!請問是不是6.3版本不能使用Program...Endprogram,如果可以使用的話,應該如何去用?

問題二
  想在COPY完ASP程式後直接實現IIS的設定,也就是通過安裝程式就可以完成,不需要手動設定,請問怎樣去實現呢?

以下就是我用Project Wizard-generated script 做好的兩個Fuction,他們不用調用也不用聲明定義就自動執行,真是搞不懂呀!我的Script該加在什麼地方呢?
// Include header files
    
#include "ifx.h"
function OnFirstUIBefore()
    number  nResult,nSetupType;
    string  szTitle, szMsg;
    string  szLicenseFile, szQuestion;
    string  szName, szCompany, szSerial;
    string  szTargetPath;
    string  szDir;
    string  szComponents, szTargetdir;
    number  nLevel;
    LIST    listStartCopy;
    number  nvSize;
begin
    nSetupType = TYPICAL;
    TARGETDIR = "C:"^"inetpub" ^"wwwroot" ^@PRODUCT_NAME;
    szDir = TARGETDIR;
    szName    = "";
    szCompany = "";
    szSerial = "";

Dlg_Start:
    // beginning of dialogs label

Dlg_SdWelcome:
    szTitle = "";
    szMsg  = "";
    nResult = SdWelcome( szTitle, szMsg );
    if (nResult = BACK) goto Dlg_Start;

Dlg_SdLicense:
    szLicenseFile = SUPPORTDIR ^ "license.txt";
    szTitle    = "";
    szMsg      = "";
    szQuestion = "";
    nResult    = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
    if (nResult = BACK) goto Dlg_SdWelcome;

Dlg_SdRegisterUserEx:
    szMsg  = "";
    szTitle = "";
    nResult = SdRegisterUserEx( szTitle, szMsg, szName, szCompany, szSerial );
    if (nResult = BACK) goto Dlg_SdLicense;

Dlg_SdAskDestPath:
    szTitle = "";
    szMsg  = "please select setup folder";
    nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 );
    TARGETDIR = szDir;  
    if (nResult = BACK) goto Dlg_SdRegisterUserEx;

Dlg_SetupType:  
    szTitle    = "";
    szMsg      = "";
    nResult = SetupType ( szTitle , szMsg , "" , nSetupType , 0 );
    if (nResult = BACK) then
        goto Dlg_SdAskDestPath;
    else
        nSetupType = nResult;
        if (nSetupType != CUSTOM) then
      szTargetPath = TARGETDIR;
      nvSize = 0;
      ComponentCompareSizeRequired(MEDIA,szTargetPath,nvSize);
      if (nvSize != 0) then      
              MessageBox( szSdStr_NotEnoughSpace, WARNING );
          goto Dlg_SetupType;
            endif;
        endif;  
    endif;

Dlg_SdComponentTree:
    if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType;
    szTitle    = "";
    szMsg      = "";
    szTargetdir = TARGETDIR;
    szComponents = "";
    nLevel = 2;
    if (nSetupType = CUSTOM) then
    nResult = SdComponentTree(szTitle, szMsg, szTargetdir, szComponents, nLevel);
    if (nResult = BACK) goto Dlg_SetupType;  
    endif;

Dlg_ObjDialogs:
    nResult = ShowObjWizardPages(nResult);
    if (nResult = BACK) goto Dlg_SdComponentTree;
    
Dlg_SdStartCopy:
    szTitle = "";
    szMsg  = "";
    listStartCopy = ListCreate( STRINGLIST );
    nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
    ListDestroy(listStartCopy);      
    if (nResult = BACK) goto Dlg_ObjDialogs;

    // setup default status
    SetStatusWindow(0, "");
    Enable(STATUSEX);
    StatusUpdate(ON, 100);
    return 0;
end;

///////////////////////////////////////////////////////////////////////////////
//
//  FUNCTION:  OnMoving
//
//  EVENT:      Moving event is sent when file transfer is started as a result of
//              ComponentTransferData call, before any file transfer operations
//              are performed.
//
///////////////////////////////////////////////////////////////////////////////
function OnMoving()
    string szAppPath;
begin
    szAppPath = TARGETDIR;
    RegDBSetItem(REGDB_APPPATH, szAppPath);
    RegDBSetItem(REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY);
end;
// --- include script file section ---


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.