Copy Code code as follows:
; My first installation script
!include "Mui2.nsh"
!define DIR "D:\workspace\nsis\files"
Name "Setup program"
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 $R 0
STRCMP $R 0 0 +3
MessageBox mb_ok| Mb_iconstop "Allow only one instance to run"
Abort
FunctionEnd
; setup Segment
Section
Setoutpath $INSTDIR
File "${dir}\ new text Document (2). txt"
File "${dir}\ new text document. txt"
Setoutpath "$INSTDIR \office"
File "${dir}\office\*"
; shortcuts
CreateShortcut "$DESKTOP \test.lnk" "$INSTDIR \unsetup.exe"
CreateShortcut "$SMPROGRAMS \test.lnk" "$INSTDIR \unsetup.exe"
Writeuninstaller "$INSTDIR \unsetup.exe"
Sectionend
; Uninstall program segment
section "Uninstall"
RMDIR/R "$INSTDIR"
Delete "$DESKTOP \test.lnk"
Delete "$SMPROGRAMS \test.lnk"
Sectionend