正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- Name "test"
- OutFile "test.exe"
- !include MUI.nsh
- !ifndef LR_LOADTRANSPARENT
- !define LR_LOADTRANSPARENT 0x0020
- !endif
- !ifndef LR_LOADFROMFILE
- !define LR_LOADFROMFILE 0x0010
- !endif
- !ifndef LR_CreateDIBSECTION
- !define LR_CreateDIBSECTION 0x2000
- !endif
- !ifndef STM_SETIMAGE
- !define STM_SETIMAGE 370
- !endif
- !ifndef IMAGE_BITMAP
- !define IMAGE_BITMAP 0
- !endif
- !ifndef sysLoadImage
- !define sysLoadImage "user32::LoadImageA(i, t, i, i, i, i) i"
- !endif
- !ifndef sysDeleteObject
- !define sysDeleteObject "gdi32::DeleteObject(i) i"
- !endif
- Var hwnd
- Var ImageHandle
- !macro DisplayImage PARENTWIN IMGHANDLE IMG_NAME
- StrCmp $ImageHandle '' +4
- StrCpy $6 $ImageHandle
- System::Call "${sysDeleteObject} (r6)"
- StrCpy $6 ''
- GetDlgItem $0 ${PARENTWIN} ${IMGHANDLE}
- System::Call '${sysLoadImage} (0, s, ${IMAGE_BITMAP}, 0, 0, ${LR_CreateDIBSECTION}|${LR_LOADFROMFILE}) .r6' "${IMG_NAME}"
- SendMessage $0 ${STM_SETIMAGE} ${IMAGE_BITMAP} $6
- StrCpy $ImageHandle $6
- !macroend
- ReserveFile "${NSISDIR}PluginsInstallOptions.dll"
- ReserveFile io.ini
- ReserveFile img1.bmp
- ReserveFile img2.bmp
- Page custom SetCustom LeaveCustom
- !insertmacro MUI_PAGE_INSTFILES
- !insertmacro MUI_LANGUAGE SimpChinese
- Section -nothing
- SectionEnd
- Function .onInit
- InitPluginsDir
- File /oname=$PLUGINSDIRio.ini io.ini
- File /oname=$PLUGINSDIRimg1.bmp img1.bmp
- File /oname=$PLUGINSDIRimg2.bmp img2.bmp
- WriteINIStr "$PLUGINSDIRio.ini" "Field 1" "Text" "$PLUGINSDIRimg1.bmp"
- FunctionEnd
- Function SetCustom
- InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIRio.ini"
- Pop $hwnd
- !insertmacro DisplayImage $hwnd 1200 "$PLUGINSDIRimg1.bmp"
- InstallOptions::show
- FunctionEnd
- Function LeaveCustom
- ReadINIStr $0 "$PLUGINSDIRio.ini" "Settings" "State"
- StrCmp $0 3 ImgBtn1
- StrCmp $0 4 ImgBtn2
- Goto InstallBtn
- ImgBtn1:
- !insertmacro DisplayImage $hwnd 1200 "$PLUGINSDIRimg1.bmp"
- Abort
- ImgBtn2:
- !insertmacro DisplayImage $hwnd 1200 "$PLUGINSDIRimg2.bmp"
- Abort
- InstallBtn:
- FunctionEnd
复制代码
- ; Ini file generated by the HM NIS Edit IO designer.
- [Settings]
- NumFields=4
- [Field 1]
- Type=Bitmap
- Left=6
- Right=201
- Top=3
- Bottom=134
- [Field 2]
- Type=Groupbox
- Text=select
- Left=212
- Right=271
- Top=6
- Bottom=60
- [Field 3]
- Type=RadioButton
- Text=img 1
- Flags=GROUP|NOTIFY
- State=1
- Left=222
- Right=260
- Top=22
- Bottom=32
- [Field 4]
- Type=RadioButton
- Text=img 2
- Flags=NOTIFY
- Left=222
- Right=260
- Top=40
- Bottom=51
复制代码 |