关于NSIS脚本语言的编写

参考链接:http://strugglexl.iteye.com/blog/1489355

以下是根据例子,自己写的可以运行出来的空安装包,大家可以自己添加DLL然后生成自己的安装包。

RequestExecutionLevel user
!include "MUI.nsh"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "SimpChinese"
!define NAME "Draw.exe"
;自行修改自己的安装包ico
;Icon "D:/Draw.ico"

Section
 SetOutPath $INSTDIR\${NAME}\bin
 ;修改自己EXE位置的快捷方式指向
 CreateShortCut $DESKTOP\${NAME}.lnk $INSTDIR\${NAME}\bin\${NAME}.exe
 SetShellVarContext All
 ;修改自己EXE位置的快捷方式指向
 CreateShortCut $SMPROGRAMS\${NAME}.lnk $INSTDIR\${NAME}\bin\${NAME}.exe
 WriteRegStr HKLM "Software\${NAME}" "" "$INSTDIR"
 ;在控制面板中可以有删除项
 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayName" "${NAME}" 
 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "UninstallString" '"$INSTDIR\${NAME}\uninst.exe"'
 WriteUninstaller "$INSTDIR\${NAME}\uninst.exe"
SectionEnd

Section "Uninstall"
 Delete $DESKTOP\${NAME}.lnk
 SetShellVarContext All
 Delete $SMPROGRAMS\${NAME}.lnk
 DeleteRegKey HKLM "Software\${NAME}"
 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}"
 RMDir /r "$INSTDIR"
SectionEnd

;输出路径。可以自己修改
OutFile "D:/Draw.exe"






你可能感兴趣的:(mfc,NSIS,vs2008,脚本编辑,脚本语句)