用ASP制作InstallShield安装程序(2)

installshield|程序

   6.3版好象是用事件驱动的:
  //////////////////////////////////////////////////////
  //
  // 函数: OnFirstUIBefore
  //
  // 事件: FirstUIBefore event is sent when installation is run for the first
  // time on given machine. In the handler installation usually displays
  // UI allowing end user to specify installation parameters. After this
  // function returns, ComponentTransferData is called to perform file
  // transfer.
  //
  //////////////////////////////////////////////////////
  
  OnFirstUIBefore()是在某台电脑上第一次运行安装时执行.
  
  //////////////////////////////////////////////////////
  //
  // 函数: OnFirstUIAfter
  //
  // 事件: FirstUIAfter event is sent after file transfer, when installation
  // is run for the first time on given machine. In this event handler
  // installation usually displays UI that will inform end user that
  // installation has been completed successfully.
  //
  //////////////////////////////////////////////////////
  OnFirstUIAfter()在文件复制结束后运行.

   下面是建立Web文件和设置的例子需VBS文件(有虚拟目录设置,但没有权限设置).
  
  ////////////////////////////////////////////////////////////////////////////////
  //
  // IIIIIII SSSSSS
  // II SS InstallShield (R)
  // II SSSSSS (c) 1996-1999, InstallShield Software Corporation
  // II SS (c) 1990-1996, InstallShield Corporation
  // IIIIIII SSSSSS All Rights Reserved.
  //
  //
  // This code is generated as a starting setup template. You should
  // modify it to provide all necessary steps for your setup.
  //
  //
  // 文件名: Setup.rul
  //
  // 描述: InstallShield script
  //
  // 注释: This template script performs a basic setup. With minor
  // modifications, this template can be adapted to create
  // new, customized setups.
  //
  ////////////////////////////////////////////////////////////////////////////////
  
  
  // 包含的头文件
  
  #include "ifx.h" //不能移动
  
  ////////////////////// string defines ////////////////////////////
  
  //////////////////// installation declarations ///////////////////
  
  // ----- DLL function prototypes -----
  
  
  // your DLL function prototypes
  
  // ---- script function prototypes -----
  
  
  // your script function prototypes
  prototype CHK_serial(STRING,STRING);
  prototype RegODBC(STRING);
  prototype set_vod_liveaddress();
  // your global variables
  STRING szvodservername;
  STRING szliveservername;
  
  
  //////////////////////////////////////////////////////////////////////////////
  //
  // 函数: OnFirstUIBefore
  //
  // 事件: FirstUIBefore event is sent when installation is run for the first
  // time on given machine. In the handler installation usually displays
  // UI allowing end user to specify installation parameters. After this
  // function returns, ComponentTransferData is called to perform file
  // transfer.
  //
  ///////////////////////////////////////////////////////////////////////////////
  function OnFirstUIBefore()
  NUMBER nResult,nSetupType;
  STRING szTitle, szMsg;
  STRING szLicenseFile, szQuestion;
  STRING svName, sVCompany, svSerial;
  STRING szFile;
  STRING szTargetPath;
  STRING szDir;
  STRING szfolder;
  STRING szComponents, szTargetdir;
  //zy
  STRING szDefault,svResult;
  STRING sDBSERVERNAME;
  OBJECT piisObj;
  //zy
  NUMBER nLevel;
  LIST listStartCopy;
  LIST list;
  NUMBER nvSize;
  STRING msg;
  begin
  
  
  //To Do: if you want to enable background, window title, and caption bar title
  // 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:
  // 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_SdShowInfoList://readme文件 对话框
  szFile = SUPPORTDIR ^ "infolist.txt";
  list = ListCreate( STRINGLIST );
  ListReadFromFile( list, szFile );
  szTitle = "";
  szMsg = "";
  nResult = SdShowInfoList( szTitle, szMsg, list );
  ListDestroy( list );
  if (nResult = BACK) goto Dlg_SdLicense;
  
  Dlg_SdReGISterUserEx://用户信息 对话框
  szMsg = "";
  szTitle = "";
  nResult = SdRegisterUserEx( szTitle, szMsg, svName, svCompany, svSerial );
  if (nResult = BACK) goto Dlg_SdShowInfoList;
  //检查序列号
  if (CHK_serial(svCompany, svSerial)<0) then
  goto Dlg_SdRegisterUserEx;
  endif;
  //检查序列号完毕
  Dlg_SdAskDestPath://安装位置 对话框
  szTitle = "";
  szMsg = "";
  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_SdSelectFolder://对话框
  szfolder = SHELL_OBJECT_FOLDER;
  szTitle = "";
  szMsg = "";
  nResult = SdSelectFolder( szTitle, szMsg, szfolder );
  SHELL_OBJECT_FOLDER = szfolder;
  if (nResult = BACK) goto Dlg_SdComponentTree;
  
  Dlg_AskText ://设置数据库服务器 对话框
  szTitle = "设置数据库服务器";
  szMsg = "";
  szQuestion="请输入SQL Server(旋风2000)数据库服务器的主机名或IP地址";
  szDefault="192.168.0.1";
  SetDialogTitle(DLG_ASK_TEXT,szTitle);
  nResult = AskText (szQuestion, szDefault, svResult);
  sDBSERVERNAME = svResult;
  if (nResult = BACK) goto Dlg_SdSelectFolder;
  RegODBC(sDBSERVERNAME);
  
  Dlg_SdStartCopy://开始复制文件 对话框
  szTitle = "";
  szMsg = "";
  listStartCopy = ListCreate( STRINGLIST );
  //The following is an example of how to add a string(svName) to a list(listStartCopy).
  //eg. ListAddString(listStartCopy,svName,AFTER);
  nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
  ListDestroy(listStartCopy);
  if (nResult = BACK) goto Dlg_AskText;
  // setup default status
  SetStatusWindow(0, "");
  Enable(STATUSEX);
  StatusUpdate(ON, 100);
  
  return 0;
  
  end;
  ///////////////////////////////////////////////////////////
  //
  // 函数: OnFirstUIAfter
  //
  // 事件: FirstUIAfter event is sent after file transfer, when installation
  // is run for the first time on given machine. In this event handler
  // installation usually displays UI that will inform end user that
  // installation has been completed successfully.
  //
  //////////////////////////////////////////////////////////
  function OnFirstUIAfter()
  STRING szTitle, szMsg1, szMsg2, szOption1, szOption2,szCmdLine;
  NUMBER bOpt1, bOpt2;
  
  begin
  szCmdLine = SUPPORTDIR ^"mkwebdir.vbs "+"-c LocalHost -w 1 -v cyclone2000 -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 虚拟目录\n\n 例:\n 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 ^"Internet Explorer"^"IEXPLORE.EXE", szCmdLine) < 0) then
  MessageBox ("不能打开浏览器.",SEVERE);
  endif;
  
  return 0;
  end;
  
  ////////////////////////////////////////////////////////

时间: 2024-08-20 07:14:12

用ASP制作InstallShield安装程序(2)的相关文章

用ASP制作InstallShield安装程序(1)

installshield|程序    我现在在做ASP的安装程序,这样可以方便用户的使用.我使用的InstallShield版本是InstallShield Professional-Standard Edition6.3.   我没有用过这个东东,问题如下:      问题一   通过Project Wizard-generated script 做好了COPY打包工作.可是6.3版本的好象不支持主体Program...Endprogram,因为我看COPY打包的Script脚本就是通过两个

用ASP制作InstallShield安装程序(3)

installshield|程序   ///////////////////////////////////////////////////////////////////////////////   //   // FUNCTION: OnMaintUIAfter   //   // EVENT: MaintUIAfter event is sent after file transfer, when end user runs   // installation that has alrea

一个完整的Installshield安装程序实例—艾泽拉斯之海洋女神出品(五) --补遗 (已补充第三部分完整版)

原文:一个完整的Installshield安装程序实例-艾泽拉斯之海洋女神出品(五) --补遗 (已补充第三部分完整版) 上一篇:一个完整的安装程序实例-艾泽拉斯之海洋女神出品(四) --高级设置二 转载时请务必保留转载出处和由艾泽拉斯之海洋女神出品的字样:如需刊登,请与作者联系.little_fairycat@126.com. 第三部分:其他 1. 修改显示界面的风格 Installshield 原始安装界面我始终觉得很丑,幸好Installscript 是可以不用写代码就可以改界面风格的.

用Wix手工编辑XML制作MSI安装程序,怎样保证安装新版本时候强制卸载旧版本,急急急!!!

问题描述 ★★我的问题如下,为了能说清楚,我写了比较长,希望能耐心看看★★本程序是一个网络监控客户端程序,安装好后会在系统中注册一个服务,为了和服务器端通信.我只是负责制作MSI安装程序,有人专门做开发,当然我对于VC++一无所知.按照常规我在wix的wxs中进行相应编辑设置,生成第一版MSI程序setup1.msi,安装在系统中,菜单显示版本号:1.4.0.3之后因为程序做了修改,所以我把版本号和ProductCode进行修改,再次生成第二版MSI安装程序setup2.msi这次根据客户要求,

如何使用ASP制作类似安装向导的页面?

安装向导|页面|安装向导 如何使用ASP制作类似安装向导的页面?面临的主要问题何在:1.界面和一个Windows Wizard完全一样,有Next和Back按钮2.用户可以使用Back按钮回到以前的任何一步,并且能够改变以前任何一步中已经选择的内容3.form必须记住所有填入的内容4.不能够使用数据库5.不能够使用Sessions,防止如果Sessiosn失效后用户的所有输入丢失,不幸的是,也不能够使用cookie因为很多拥护经常关掉浏览器的Cookie选项.6.可移植性要好,因为它要适应安装步

制作asp.net的安装程序

asp.net|程序 1.打开VS.NET开发环境;2."文件"->"新建"->"项目";3."项目类型"选"安装和部署项目","模板"选"Web安装项目",然后填写"名称"和"位置",最后"确定";4.鼠标右击"解决方案",选择"添加"->"

VS2008如何制作一个安装程序,并且判断是否安装别的软件,如果没有,则需先安装别的软件

问题描述 大侠们:小弟现在想在VS2008上创建一个安装程序,但是这个安装程序得判断是否安装了a.exe文件,如果没有责先进行a.exe文件的安装,安装完成之后紧接着安装本项目的程序.请问该如何实现呢? 解决方案 解决方案二:1新建安装部署项目打开VS,点击新建项目,选择:其他项目类型->安装与部署->安装向导(安装项目也一样),然后点击确定.2安装向导关闭后打开安装向导,点击下一步,或者直接点击完成.3开始制作安装向导完成后即可进入项目文件夹:双击"应用程序文件夹"在右边

asp制作的日历程序

纯ASP打造的日历程序,可自行美化,这里仅提供最简单的CSS样式... <style>body{font-size:12px; margin:20px 0 0 20px; padding:0}tr,td{text-align:center;}</style><%'================================='说明:日历文件'================================='取出对应的年月博客日志数据'==================

制作C#安装程序,数据库打包,下面是安装时附加数据库代码,为何不行?

问题描述 usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Configuration.Install;usingSystem.Data;usingSystem.Data.SqlClient;namespaceInstallDB{[RunInstaller(true)]publicpartialclassInstallerDB:Installer{publicInstallerDB