惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - YiStudio

在Word中插入图片 DataGridView多列排序 将Word嵌入到自己的程序中 一个非常不错的压缩组件 免费的国产报表Grid++Reprot 使用NSIS制作安装包(2) SharpDevelop2.0 用Firebird .NET Data Provider编写.NET应用程序(2) 用Marathon管理Firebird数据库(2) 用Firebird .NET Data Provider编写.NET应用程序(1) 用Marathon管理Firebird数据库(1) Firebird简介 NDoc修改手记(三) NDoc修改手记(二) NDoc修改手记(一) WebForm中将DataGrid中导出数据的方法 FxCop EXCEL2003中使用XML 动态加载类(动态加载DLL文件)
使用NSIS制作安装包(1)
YiStudio · 2006-04-18 · via 博客园 - YiStudio

NSIS是一个基于脚本语言的制作安装包的免费工具,它使用起来也很方便,下面是制作安装.NET框架和语言包的脚本。

NSIS的编译器和脚本编辑工具可以到nsis.sf.net上下载

!include WordFunc.nsh
!insertmacro VersionCompare
!include LogicLib.nsh

Name ".NET运行库"
OutFile "DotNetSetup.exe"

var "DOTNETFX_RETURN_CODE"
var "DOTNETLang_RETURN_CODE"
var "ERROR_DOTNET_FATAL"
var "INSTALL_SUCCESS"

Function .onInit
    StrCpy $ERROR_DOTNET_FATAL "在安装.NET运行库时出现一个严重的错误,安装.NET运行库失败!"
    StrCpy $INSTALL_SUCCESS "安装成功!"
   
    Call GetDotNETVersion
    pop $0
    ${If} $0 == "not found"
        Call InstallDotNetFx
        pop $DOTNETFX_RETURN_CODE
        ${If} $DOTNETFX_RETURN_CODE <> 0
            MessageBox MB_OK|MB_ICONSTOP $ERROR_DOTNET_FATAL
            Abort
        ${EndIf}
       
        Call InstallDotNetLang
        pop $DOTNETLang_RETURN_CODE
        ${If} $DOTNETLang_RETURN_CODE <> 0
            MessageBox MB_OK|MB_ICONINFORMATION $INSTALL_SUCCESS
            Abort
        ${EndIf}
    ${EndIf}

    StrCpy $0 $0 "" 1 # skip "v"

    ${VersionCompare} $0 "2.0" $1
    ${If} $1 == 2
        Call InstallDotNetFx
        pop $DOTNETFX_RETURN_CODE
        ${If} $DOTNETFX_RETURN_CODE <> 0
            MessageBox MB_OK|MB_ICONSTOP $ERROR_DOTNET_FATAL
            Abort
        ${EndIf}

        Call InstallDotNetLang
        pop $DOTNETLang_RETURN_CODE
        ${If} $DOTNETLang_RETURN_CODE <> 0
            MessageBox MB_OK|MB_ICONINFORMATION $INSTALL_SUCCESS
            Abort
        ${EndIf}
    ${EndIf}
FunctionEnd
;获取.NET版本,此函数在nsis.sf.net中有
Function GetDotNETVersion
    Push $0
    Push $1

    System::Call "mscoree::GetCORVersion(w .r0, i ${NSIS_MAX_STRLEN}, *i) i .r1"
    StrCmp $1 "error" 0 +2
    StrCpy $0 "not found"

    Pop $1
    Exch $0
FunctionEnd
;安装.NET框架
Function InstallDotNetFx
    push $DOTNETFX_RETURN_CODE
    StrCpy $DOTNETFX_RETURN_CODE "0"
    SetOutPath "$PLUGINSDIR"
    File /r "dotnetfx.exe"
    Banner::show /NOUNLOAD "正在安装.NET运行库..."
    nsExec::ExecToStack '"dotnetfx.exe" /q /c:"install.exe /noaspupgrade /q"'
    ;pop $DOTNETFX_RETURN_CODE
    Banner::destroy
FunctionEnd
;安装语言包
Function InstallDotNetLang
    push $DOTNETLang_RETURN_CODE
    StrCpy $DOTNETLang_RETURN_CODE "0"
    SetOutPath "$PLUGINSDIR"
    File /r "langpack.exe"
    Banner::show /NOUNLOAD "正在安装.NET运行库中文语言包..."
    nsExec::ExecToStack '"langpack.exe" /q /c:"install.exe /noaspupgrade /q"'
    ;pop $DOTNETLang_RETURN_CODE
    Banner::destroy
FunctionEnd

Section
SectionEnd