6)闪屏界面,可以在源代码中加入下列代码即可:
A、普通效果

 

以下是代码片段:
Function .onInit
SetOutPath $TEMP
File /oname=spltmp.bmp "G:\Temp\Nsisres\splash.bmp"

splash::show 2300 $TEMP\spltmp

Pop $0

FunctionEnd



效果图如此软件下载:pdf2all-setup.rar
B、渐隐闪屏

 

以下是代码片段:
Function .OnInit
InitPluginsDir
File /oname=$PLUGINSDIR\splash.bmp "G:\Temp\Nsisres\splash.bmp"
advsplash::show 1500 800 600 -1 $PLUGINSDIR\splash
Functionend



7)背景音乐[贯穿安装过程]

 

以下是代码片段:
Var hmci
Function .OnInit
InitPluginsDir
SetOutPath $PLUGINSDIR
File "G:\Temp\Nsisres\music.mp3"              [说明:源MP3的存放路径]
System::Call msvfw32.dll::MCIWndCreate(i 0, i 0,i 0x0070, t "$PLUGINSDIR\music.mp3") i .r0
SendMessage $0 0x0465 0 "STR:play repeat"
System::Call user32.dll::ShowWindow(i r0, i 0)
StrCpy $hmci $0
Functionend

Section
;add your codes
SendMessage $hmci 0x0010 0 0
Sectionend


后语:

 

NSIS文本操作

 

FileOpen $0 "$EXEDIR\a.txt" w
FileWrite $0 "360安全网"
FileWriteByte $0 "13"

FileWriteByte $0 "10"

 FileWrite $0 "www.hack59.com"

 FileClose $0

 

!include "TextFunc.nsh"
!include "WordFunc.nsh"

Section
  ;读取文本文件,写入文本文件,读取第一行到最后一行。
  ${LineFind} "xxx.ini" "xxx.ini" "1:-1" "Config"
SectionEnd

Function Config
  ${WordReplace} $R9 'PATH="值"' 'PATH="www.hack59.com替换成你想要的"' "+*" $R9
  Push $0
FunctionEnd

 

posted on 2016-07-29 09:17  默默淡然  阅读(706)  评论(0编辑  收藏  举报