最新消息:

注册表记录组件是否已选

nsis 永恒心锁 909浏览 0评论
!include "MUI2.nsh"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "SimpChinese"
Name "注册表记录组件是否已选"
OutFile "注册表记录组件是否已选.exe"
InstallDir "$TEMP"
Section /o "快捷方式" SEC01
 WriteRegStr HKCU "dome" "Desktop" "yes"
SectionEnd
Section /o "开始菜单" SEC02
 WriteRegStr HKCU "dome" "Start Menu" "yes"
SectionEnd
Function .onInit
 ReadRegStr $R1 HKCU "dome" "Desktop"
 ${If} $R1 != ""
 SectionGetFlags ${SEC01} $R0
 IntOp $0 $R0 | ${SF_SELECTED}
 SectionSetFlags ${SEC01} $0
 ${EndIf}
 ReadRegStr $R2 HKCU "dome" "Start Menu"
 ${If} $R2 != ""
 SectionGetFlags ${SEC02} $R0
 IntOp $0 $R0 | ${SF_SELECTED}
 SectionSetFlags ${SEC02} $0
 ${EndIf}
 DeleteRegKey HKCU "dome" ;这里为什么要删除呢?因为我只需要记录上次安装的组件选择情况,否则,这一句删除即可。
FunctionEnd
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » 注册表记录组件是否已选

您必须 登录 才能发表评论!