zoukankan      html  css  js  c++  java
  • 手机探索者开发实录—制作MobileX插件的安装包

    手机探索者开发实录—制作MobileX插件的安装包

    转载时请注明出处和作者联系方式
    作者联系方式:李先静 <xianjimli at hotmail dot com>

    制作安装包有很多方法,但我喜欢最简单的方法,所以选择了iexpress。它是Windows自带的,简单易用,当然功能也很简单,它把所有文件打包成一个EXE文件,运行时解压到一个临时目录,然后运行指定的程序,其它的事情都要自己做了。

    VBScript也是我很喜欢的脚本,虽然我一年中也难得用它一次。但它非常容易上手,也不需要在IDE里开发,而且功能强大,操作COM组件真是得心应手。所以我决定用VBScript作为安装脚本,让安装程序在解压完成时调用。Install.vbs内容如下:

    1. 'Mobile Explorer for MobileX installer

    2. set shl = CreateObject("WScript.Shell")
    3. set fso = CreateObject("Scripting.FileSystemObject")
    4. set sha = CreateObject("Shell.Application")

    5. install_path = shl.ExpandEnvironmentStrings("%ProgramFiles%") + "/mobile_me"
    6. system_root = shl.ExpandEnvironmentStrings("%SystemRoot%") + "/system32"

    7. if fso.FolderExists(install_path) then
    8.     fso.DeleteFolder(install_path)
    9. end if

    10. fso.CreateFolder(install_path)

    11. set folder = fso.GetFolder("./")
    12. set files = folder.files

    13. for each file in files
    14.     file.Copy(install_path + "/" + file.name)
    15. next

    16. filenames = Split("libexpat.dll,mehost.dll,mobilex_me.dll"",")
    17. for x=0 to UBound(filenames)
    18.     set file = fso.GetFile(install_path + "/" + filenames(x))
    19.     file.Copy(system_root + "/" + filenames(x))
    20. next
    21. sha.ShellExecute  install_path + "/WceRndis.inf",  """""install", 1
    22. sha.ShellExecute  install_path + "/WceIS.inf""""""install", 1
    23. sha.ShellExecute  install_path + "/wceusbsh.inf""""""install", 1
    24. shl.Run "regsvr32 """ + system_root + """/mobilex_me.dll", , true


    uninstall.vbs:

    1. 'Mobile Explorer for MobileX uninstaller

    2. set shl = CreateObject("WScript.Shell")
    3. set fso = CreateObject("Scripting.FileSystemObject")

    4. install_path = shl.ExpandEnvironmentStrings("%ProgramFiles%") + "/mobile_me"
    5. system_root = shl.ExpandEnvironmentStrings("%SystemRoot%") + "/system32"

    6. shl.Run "regsvr32 /u """ + system_root + """/mobilex_me.dll", , true

    7. On   Error   Resume   Next
    8. if fso.FolderExists(install_path) then
    9.     fso.DeleteFolder(install_path)
    10. end if

    11. filenames = Split("libexpat.dll,mehost.dll,mobilex_me.dll"",")
    12. for x=0 to UBound(filenames)
    13.     filename=system_root + "/" + filenames(x)
    14.     if fso.FileExists(filename) then
    15.         fso.DeleteFile(filename)
    16.     end if
    17. next
    ~~end~~

  • 相关阅读:
    同一根域名的多站点登录共享
    mysql忘记管理员密码
    使用Cacti监控你的网络(四) Cacti脚本及模板
    使用Cacti时常见的问题集
    SQL Server:SQL Like 通配符特殊用法:Escape
    IS6.0 应用程序池Web园导致Session丢失
    VMware建立虚拟机无法上网
    SqlServer 添加用户 添加角色 分配权限
    教你如何在SQL Server数据库中加密数据
    sendmail邮件服务器搭载smtp和pop3认证的配置方法
  • 原文地址:https://www.cnblogs.com/zhangyunlin/p/6167618.html
Copyright © 2011-2022 走看看