码迷,mamicode.com
首页 > 其他好文 > 详细

使用NSIS (NullSoft Scriptable Install System)制作安装程序

时间:2014-11-04 13:09:55      阅读:263      评论:0      收藏:0      [点我收藏+]

标签:虚拟机   nsis   download   strcpy   

Name "capture"
OutFile "capture.exe"
InstallDir "$PROGRAMFILES\capture"
Page directory
Page INSTFILES
UninstPage uninstConfirm
UninstPage instfiles
Var remote_zip_file
Var local_zip_file
Section ""
SetOutPath $INSTDIR
;Call DownloadVM
Call DownLoadImage
/*增加快捷方式到桌面和windows菜单*/
CreateDirectory "$SMPROGRAMS\capture\capture.exe"
CreateShortCut "$SMPROGRAMS\capture\capture.lnk" $INSTDIR\capture.exe
CreateShortCut "$DESKTOP\截图工具.lnk" $INSTDIR\capture.exe
Exec "$INSTDIR\capture.exe"
SetAutoClose true




/*增加卸载相关的模块*************************************
Section "Uninstall"
Delete "$INSTDIR\*.exe"
RMDir "$INSTDIR"
#快捷方式的删除
Delete "$SMPROGRAMS\capture\capture.lnk"
Delete "$DESKTOP\capture.lnk"
Delete "$SMPROGRAMS\capture\uninstall.lnk"
Sectionend
*/




/***************提供有uninstall.exe******************************************/
#CreateShortCut "$SMPROGRAMS\capture\uninstall.exe "$INSTDIR\uninstall.lnk"
#WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
;下载虚拟机


;下载映像
Function DownloadImage
StrCpy $remote_zip_file "http://lx.cdn.baidupcs.com/file/891b5d0cbcb36bfdfe1cf78e1b9a8606?bkt=p-f90fc2fcdb6bd141f37ee85d5dff6ef4&xcode=df2721f30e8b40d859c28ca7a3cf771bfef5f5d35a1b8d3d837047dfb5e85c39&fid=1277056680-250528-223982309163508&time=1415073762&sign=FDTAXERB-DCb740ccc5511e5e8fedcff06b081203-BWh3U6%2BrJc7Jq%2FfqafcdbWT%2FwGI%3D&to=sc&fm=Bei,B,U,nc&sta_dx=1&sta_cs=17&sta_ft=exe&sta_ct=6&newver=1&newfm=1&flow_ver=3&expires=8h&rt=pr&r=488712453&mlogid=1177857759&vuk=1277056680&vbdid=425043010&ifn=capture.exe&fn=capture.exe"
StrCpy $local_zip_file "capture.exe"
Call DownloadFile
FunctionEnd
/*************************************************/
#函数名:DownloadFile
#参数:remote_zip_file 文件下载地址,local_zip_file 下载到本地的相对路径名
#返回值:无
#描述:将网络文件下载到指定的本地目录进行安装
/************************************************/
Function DownloadFile
NSISdl::download $remote_zip_file "$INSTDIR\$local_zip_file"
Pop $R0
StrCmp $R0 "success" download_ok
SetDetailsView show
DetailPrint "download failed:$R0"
Abort
download_ok:
DetailPrint "downdload $R0 ok"
FunctionEnd





使用NSIS (NullSoft Scriptable Install System)制作安装程序

标签:虚拟机   nsis   download   strcpy   

原文地址:http://blog.csdn.net/luguifang2011/article/details/40783009

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!