欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

bat腳本實(shí)例實(shí)現(xiàn)只允許運(yùn)行一個(gè)實(shí)例(安裝程序、創(chuàng)建快捷方式腳本)

 更新時(shí)間:2014年04月17日 15:28:26   作者:  
這篇文章主要介紹了一個(gè)bat腳本實(shí)例,功能是只允許運(yùn)行一個(gè)實(shí)例、安裝程序、卸載程序、創(chuàng)建快捷方式,需要的朋友可以參考下

復(fù)制代碼 代碼如下:

;我的第一個(gè)安裝腳本
!include "MUI2.nsh"
!define DIR "D:\workspace\nsis\files"

Name "安裝程序"
Icon "${DIR}\setup128.ico"
OutFile "setup.exe"
InstallDir "$PROGRAMFILES\kaserv"
RequestExecutionLevel admin

!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "SimpChinese"

Function .onInit
 System::Call 'kernel32::CreateMutexA(i 0,i 0,t "SMAPLE_MUTEX") i .r1 ?e'
 Pop $R0
 StrCmp $R0 0 +3
 MessageBox MB_OK|MB_ICONSTOP "只允許運(yùn)行一個(gè)實(shí)例"
 Abort
FunctionEnd

;安裝程序段
Section
SetOutPath $INSTDIR
File "${DIR}\新建文本文檔 (2).txt"
File "${DIR}\新建文本文檔.txt"
SetOutPath "$INSTDIR\office"
File "${DIR}\office\*"
;快捷方式
CreateShortCut "$DESKTOP\test.lnk" "$INSTDIR\unsetup.exe"
CreateShortCut "$SMPROGRAMS\test.lnk" "$INSTDIR\unsetup.exe"
WriteUninstaller "$INSTDIR\unsetup.exe"
SectionEnd

;卸載程序段
Section "Uninstall"
RMDir /r "$INSTDIR"
Delete "$DESKTOP\test.lnk"
Delete "$SMPROGRAMS\test.lnk"
SectionEnd

相關(guān)文章

最新評(píng)論