; 开始记录 log 档案 !ifdef NSIS_CONFIG_LOG LogSet on !endif
中间是档案安装
; 结束 log 档案记录 !ifdef NSIS_CONFIG_LOG LogSet off !endif
这样记录一个 install.log 档案,并储存于安装目录,用于卸载时调用
!include "MUI.nsh" !include "UsefulLib.nsh" OutFile "Setup.exe" ; 组件选择页面 !define MUI_COMPONENTSPAGE_NODESC !define MUI_COMPONENTSPAGE_TEXT_TOP " " ComponentText "" "选择游戏安装的版本:" "----------------------" !insertmacro MUI_PAGE_COMPONENTS Section "!主要程序" SEC01 ;!表示粗体描黑 SectionEnd SubSection "界面语言" SEC0A Section /o "原始英文版" SEC11 ;/O 表示默认不选 SectionEnd Section "简体中文版" SEC12 SectionEnd SubSectionEnd SubSection "存档文件" SEC0B Section /o "全英文球员名(锁定)" SEC21 SectionEnd Section -SEC22 ; -表示隐藏 SectionEnd Section "中日韩球员中文名(锁定)" SEC23 SectionEnd Section /o "中日韩球员中文名(解锁)" SEC24 SectionEnd SubSectionEnd SubSection /e "解说版本" SEC0C ;/e表示展开 Section /o "英语解说" SEC31 SectionEnd Section "中文解说" SEC32 SectionEnd Section /o "日语解说" SEC33 SectionEnd SubSectionEnd ; ------ 游戏组件选择界面结束 ------ ; 区段组件描述 Function .onInit SectionGetFlags "${SEC0A}" $R0 IntOp $R0 $R0 + 15 SectionSetFlags "${SEC0A}" $R0 SectionGetFlags "${SEC0B}" $R0 IntOp $R0 $R0 + 15 SectionSetFlags "${SEC0B}" $R0 SectionGetFlags "${SEC0C}" $R0 IntOp $R0 $R0 + 15 SectionSetFlags "${SEC0C}" $R0 SectionSetFlags ${SEC12} ${SF_SELECTED} SectionSetFlags ${SEC23} ${SF_SELECTED} SectionSetFlags ${SEC32} ${SF_SELECTED} StrCpy $1 ${SEC12} ; SEC12默认选中 <======= “;”粘在了“}”的后面,变成了不是注释了 StrCpy $2 ${SEC23} ; SEC23默认选中 <======= “;”粘在了“}”的后面,变成了不是注释了 StrCpy $3 ${SEC32} ; SEC32默认选中 <======= “;”粘在了“}”的后面,变成了不是注释了 FunctionEnd ;单选 Function .onSelChange !insertmacro StartRadioButtons $1 !insertmacro RadioButton ${SEC11} !insertmacro RadioButton ${SEC12} !insertmacro EndRadioButtons !insertmacro StartRadioButtons $2 !insertmacro RadioButton ${SEC21} !insertmacro RadioButton ${SEC22} !insertmacro RadioButton ${SEC23} !insertmacro RadioButton ${SEC24} !insertmacro EndRadioButtons !insertmacro StartRadioButtons $3 !insertmacro RadioButton ${SEC31} !insertmacro RadioButton ${SEC32} !insertmacro RadioButton ${SEC33} !insertmacro EndRadioButtons FunctionEnd