简单易用的安装文件制作工具NSIS的使用demo示例
SetOutPath $INSTDIR\mplayer
;
; This script is based on VRA.nsi, but it remember the directory,
; has uninstall support and (optionally) installs start menu shortcuts.
;
; It will install VRA.nsi into a directory that the user selects,
;--------------------------------
; The name of the installer
Name "VRA installer"
InstallDir "C:\VRA"
; The file to write
; OutFile "example2.exe"
OutFile "VRA_Installer.exe"
RequestExecutionLevel admin
; The default installation directory
;InstallDir $PROGRAMFILES\VRA
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\VRA" "Install_Dir"
; Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------------
; Pages
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
; The stuff to install
Section "VRA (required)"
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
;File "example2.nsi"
File "bz2.pyd"
File "MSVCP90.dll"
File "MSVCR90.dll"
File "msvcrt.dll"
File "pycpuid._pycpuid.pyd"
File "python27.dll"
File "pywintypes27.dll"
File "screen_left.bmp"
File "select.pyd"
File "unicodedata.pyd"
File "user32.dll"
File "VRA.exe"
File "VRA.exe.manifest"
File "win32api.pyd"
File "win32evtlog.pyd"
File "wx._controls_.pyd"
File "wx._core_.pyd"
File "wx._gdi_.pyd"
File "wx._misc_.pyd"
File "wx._windows_.pyd"
File "wxbase30u_net_vc90.dll"
File "wxbase30u_vc90.dll"
File "wxmsw30u_adv_vc90.dll"
File "wxmsw30u_core_vc90.dll"
File "wxmsw30u_html_vc90.dll"
File "_ctypes.pyd"
File "_hashlib.pyd"
File "_socket.pyd"
File "_ssl.pyd"
File "mplayer.exe"
CreateDirectory $INSTDIR\mplayer
SetOutPath $INSTDIR\mplayer
File "mplayer\config"
SetOutPath $INSTDIR
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\VRA "Install_Dir" "$INSTDIR"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" Shell "$INSTDIR\VRA.exe"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VRA" "VRA" "VRA"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VRA" "Uninstall_VRA" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VRA" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VRA" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\VRA"
CreateShortCut "$SMPROGRAMS\VRA\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\VRA\VRA.lnk" "$INSTDIR\VRA.exe" "" "$INSTDIR\VRA.exe" 0
SectionEnd
; Optional section (can be disabled by the user)
Section "Desktop Shortcuts" SectionX
SetShellVarContext current
CreateShortCut "$DESKTOP\VRA.lnk" "$INSTDIR\VRA.exe"
;WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\layers" "$INSTDIR\VRA.exe" "RUNASADMIN"
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VRA"
DeleteRegKey HKLM SOFTWARE\VRA
; Remove files and uninstaller
;Delete $INSTDIR\example2.nsi
;Delete $INSTDIR\uninstall.exe
Delete "$INSTDIR\bz2.pyd"
Delete "$INSTDIR\Microsoft.VC90.CRT.manifest"
Delete "$INSTDIR\msvcm90.dll"
Delete "$INSTDIR\msvcp90.dll"
Delete "$INSTDIR\msvcr90.dll"
Delete "$INSTDIR\msvcrt.dll"
Delete "$INSTDIR\pycpuid._pycpuid.pyd"
Delete "$INSTDIR\python27.dll"
Delete "$INSTDIR\pywintypes27.dll"
Delete "$INSTDIR\screen_left.bmp"
Delete "$INSTDIR\select.pyd"
Delete "$INSTDIR\unicodedata.pyd"
Delete "$INSTDIR\user32.dll"
Delete "$INSTDIR\VRA.exe"
Delete "$INSTDIR\VRA.exe.manifest"
Delete "$INSTDIR\win32api.pyd"
Delete "$INSTDIR\win32evtlog.pyd"
Delete "$INSTDIR\wx._controls_.pyd"
Delete "$INSTDIR\wx._core_.pyd"
Delete "$INSTDIR\wx._gdi_.pyd"
Delete "$INSTDIR\wx._misc_.pyd"
Delete "$INSTDIR\wx._windows_.pyd"
Delete "$INSTDIR\wxbase30u_net_vc90.dll"
Delete "$INSTDIR\wxbase30u_vc90.dll"
Delete "$INSTDIR\wxmsw30u_adv_vc90.dll"
Delete "$INSTDIR\wxmsw30u_core_vc90.dll"
Delete "$INSTDIR\wxmsw30u_html_vc90.dll"
Delete "$INSTDIR\_ctypes.pyd"
Delete "$INSTDIR\_hashlib.pyd"
Delete "$INSTDIR\_socket.pyd"
Delete "$INSTDIR\_ssl.pyd"
Delete "$INSTDIR\mplayer.exe"
Delete "$INSTDIR\mplayer\config"
Delete "init.check"
Delete "init.video"
Delete "kamhearing.log"
Delete "player_reg.dll"
Delete "uninstall.exe"
; Remove shortcuts, if any
Delete "$SMPROGRAMS\VRA\*.*"
Delete "$SMPROGRAMS\VRA\VRA.lnk"
; Remove directories used
RMDir "$SMPROGRAMS\VRA"
RMDir "$INSTDIR\mplayer"
RMDir "$INSTDIR"
SectionEnd
最新文章
- @echo off 与echo off
- git命令大全
- 5种风格的 jQuery 分页效果【附代码】
- Linux Native Aio 异步AIO的研究
- 兼容ie7的导航下拉菜单
- Wunder Fund Round 2016 (Div. 1 + Div. 2 combined) B. Guess the Permutation 水题
- tomcat初识
- Servlet3.0学习总结(三)——基于Servlet3.0的文件上传
- 某Python群的入群题目
- 网页HTML1
- 《第一行代码》学习笔记15-UI(4)
- JMS理解2
- Jenkins 远程构建任务
- vscode 同步配置插件
- rand和randn
- HDU-1011 Starship Troopers(树形dp)
- 软件工程作业 - 实现WC功能(java)
- 撩课-Web大前端每天5道面试题-Day24
- Unix IPC之Posix消息队列(1)
- html 中的列表
热门文章
- CAD中批量打印
- ubuntu下配置华为交换机s2016
- Struts2(九)OGNL标签一与Struts2标签
- 通过实例看懂diff命令输出
- 关于 qtchooser
- SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释(转)
- 转:体积阴影(Shadow Volumes)生成算法
- shell 脚本启动spring boot的jar 包
- ios中二维码的用法
- (原)tensorflow中提示CUDA_ERROR_LAUNCH_FAILED