蓝色网际ACDSee美化版

;************************************************************
;脚本编写: 蓝色网际
;某些使用了 LogSet 指令的脚本需要使用特别版的 makensis.exe 才能通过编译
;地址: http://nsis.sourceforge.net/download/specialbuilds/
; 定义 DEBUG 时安装完成将弹出安装信息
;!define DEBUG
;************************************************************
!ifdef NSIS_MOD_CHS
Name                 "ACDSee 3.1 SR1 美化版 build ${__MONTH__}${__DAY__}"
!else
Name                 "ACDSee 3.1 SR1 美化版"
!endif
OutFile              "acdc31sr1.exe"
SetCompressor        lzma
SpaceTexts           none
ShowInstDetails      show
BrandingText         "$(^NameDA)安装程序 ${__DATE__} "
UninstallCaption     "$(^NameDA)卸载程序"
ShowUninstDetails    show
InstallDir           "$PROGRAMFILESACDSee"
InstallDirRegKey     HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" InstallDir
ReserveFile          ".resourceacdsee.ini"
ReserveFile          ".resourcegaydata.ini"
ReserveFile          "${NSISDIR}PluginsSystem.dll"
!include             "MUI2.nsh"
!include             "StrFunc.nsh"
!include             "Sections.nsh"
!define MUI_ICON ".resourceico-inst.ico"
!define MUI_UNICON ".resourceico-uninst.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP ".resourceWinz.bmp"
!define MUI_COMPONENTSPAGE_CHECKBITMAP ".resourceacdsee.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP ".resourceHeader.bmp"
!define MUI_WELCOMEPAGE_TEXT "ACDSee 是目前最流行的数字图象处理软件,它能广泛应用于图片的获取、管理、浏览、优化甚至和他人的分享!使用 ACDSee,你可以从数码相机和扫描仪高效获取图片,并进行便捷的查找、组织和预览。超过 50 种常用多媒体格式被一网打尽!作为最重量级看图软件,它能快速、高质量显示您的图片,再配以内置的音频播放器,我们就可以享用它播放出来的精彩幻灯片了。ACDSee 还能处理如 Mpeg 之类常用的视频文件。此外 ACDSee 是您最得心应手的图片编辑工具,轻松处理数码影像,拥有的功能像去除红眼、剪切图像、锐化、浮雕特效、曝光调整、旋转、镜像等等,还能进行批量处理。"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ChageFONT
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE ".resourceLicense.rtf"
Page custom SetCustom
!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentPre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ComponentShow
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_PAGE_HEADER_TEXT "文件关联"
!define MUI_PAGE_HEADER_SUBTEXT "选择需要关联的文件格式"
!define MUI_PAGE_CUSTOMFUNCTION_PRE AsscoiationPre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW AsscoiationShow
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ChageFONT
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "SimpChinese"
ChangeUI IDD_SELCOM ".resourceacdsee_nodesc.exe"
;声明字串操作指令
${StrCase} ;小写转大写
!macro ASSOC EXT ICON
Push $0
Push $1
${StrCase} $0 '${EXT}' "U"
ReadRegStr $1 HKCR ".${EXT}" ""
${If} $1 != "ACDSee.$0"
WriteRegStr HKCR ".${EXT}UndoClass" "" $1
WriteRegStr HKCR "ACDSee.File" "${EXT}" ""
${ElseIf} $1 != ""
DeleteRegValue HKCR "ACDSee.$0shellopenDropTarget" Clsid
DeleteRegValue HKCR "ACDSee.$0shellopen" MuiVerb
${EndIf}
DeleteRegKey HKCU "SoftwareMicrosoftWindowsCurrentVersionExplorerFileExts.${EXT}"
WriteRegStr HKCR ".${EXT}" "" "ACDSee.$0"
WriteRegStr HKCR "ACDSee.$0" "" "ACDSee $0 图像"
WriteRegStr HKCR "ACDSee.$0DefaultIcon" "" "${ICON}"
WriteRegStr HKCR "ACDSee.$0shell" "" Open
WriteRegStr HKCR "ACDSee.$0shellOpen" "" "用 ACDSee 打开"
WriteRegStr HKCR "ACDSee.$0shellOpenCommand" "" '"$INSTDIRACDSee.exe" /dde'
WriteRegStr HKCR "ACDSee.$0shellOpenDDEExec" "" '[open("%1")]'
WriteRegStr HKCR "ACDSee.$0shellOpenDDEExecApplication" "" ACDSee
WriteRegStr HKCR "ACDSee.$0shellOpenDDEExecTopic" "" System
WriteRegStr HKCR "ACDSee.$0shellACDPrint" "" "用 ACDSee 打印"
WriteRegStr HKCR "ACDSee.$0shellACDPrintCommand" "" '"$INSTDIRACDSee.exe" /p "%1"'
ReadRegStr $1 HKCR "CLSID{68f32140-2ca3-11d0-acc1-444553540000}" ""
StrCmp $1 "" +2
WriteRegStr HKCR "ACDSee.$0shellexContextMenuHandlersPicaView" "" "{68f32140-2ca3-11d0-acc1-444553540000}"
DetailPrint "关联文件: .$0"
Pop $1
Pop $0
!macroend
!macro ASSOC_TYPE EXT TYPE
Push $0
ReadRegStr $0 HKCR ".${EXT}" ""
StrCmp $0 "ACDSee.${TYPE}" +3
WriteRegStr HKCR ".${EXT}UndoClass" "" $0
WriteRegStr HKCR "ACDSee.FILE" "${EXT}" ""
DeleteRegKey HKCU "SoftwareMicrosoftWindowsCurrentVersionExplorerFileExts.${EXT}"
WriteRegStr HKCR ".${EXT}" "" "ACDSee.${TYPE}"
Pop $0
!macroend
;压缩档右键命令
!macro ASSOC_ARCHIVE EXT ARCHIVE_PLUGINS
Push $0
ReadRegStr $0 HKCR ".${EXT}" ""
${If} $0 == "" ;如果压缩文件没有关联则进行关联
${StrCase} $0 '${EXT}' "U"
!insertmacro ASSOC "${EXT}" "${ARCHIVE_PLUGINS}"
WriteRegStr HKCR "ACDSee.${EXT}" "" "ACDSee 压缩文档($0)"
DeleteRegKey HKCR "ACDSee.${EXT}shell"
${Else}
ReadRegStr $0 HKCR ".${EXT}" ""
WriteRegStr HKCR "$0ShellACDSeeView" "" "用 ACDSee 察看"
WriteRegStr HKCR "$0ShellACDSeeViewcommand" "" '"$INSTDIRACDSee.exe" "%1"'
WriteRegStr HKCR "ACDSee.FileArchive" "$0ShellACDSeeView" ""
${EndIf}
Pop $0
!macroend
!macro SelectIfSet SECTION
Push $0
Push $1
SectionGetFlags "${SECTION}" $0
IntOp $1 $0 & ${SF_SELECTED}
StrCmp $1 ${SF_SELECTED} +5
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags "${${SECTION}}" $0
SectionSetText "${${SECTION}}" ""
Goto +3
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags "${${SECTION}}" $0
Pop $1
Pop $0
!macroend
Section "主程序及标准插件" main
SectionIn RO
;系统文件
SetOverwrite off
SetOutPath $SYSDIR
#File ".includeRoboex32.dll"
#File ".includemsvcr71.dll"
SetOverwrite on
Delete "$INSTDIRinstall.log"
LogSet on
SetOutPath $INSTDIR
#File /r ".includemain*.*"
SetOutPath "$INSTDIRPlugIns"
StrCpy $0 "$INSTDIRPlugInsIDE_ACDStd.apl"
ClearErrors
Delete $0
${If} ${Errors}
GetTempFileName $1
StrCpy $0 $1
${EndIf}
#File "/oname=$0" ".includepluginsIDE_ACDStd.apl"
${IfThen} $0 == $1 ${|} Rename /REBOOTOK $0 "$INSTDIRPlugInsIDE_ACDStd.apl" ${|}
#File ".includepluginsIDE_ACDStd.chm"
WriteRegStr HKLM "SOFTWAREACD SystemsPlugInsV1" PIFolder "$INSTDIRPlugIns"
WriteRegBin HKLM "SOFTWAREACD SystemsACDInTouch" "InTouchSettings" 01013d00000000000700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000
WriteRegStr HKLM "SOFTWAREACD SystemsACDSee" "" 3.1.1
WriteRegStr HKLM "SOFTWAREACD SystemsACDSeeCS" "" 3.1.1
WriteRegBin HKLM "SOFTWAREACD SystemsACDSeeCS" InTouchSettings 01535c4300000000
WriteRegStr HKLM "SOFTWAREACD SystemsACDSeeCS" SourceID 001
WriteRegStr HKLM "SOFTWAREACD SystemsACDSeeCS" InstallationDate HBNHFNEGGHCKKJDN091A4FB9
WriteRegStr HKLM "SOFTWAREACD SystemsACDSeeCS" InTouchConfigRemind CJPJNNEGGHCKKBBI08599FBA
WriteRegStr HKLM "SOFTWAREMicrosoftWindowsCurrentVersionApp PathsACDSee.exe" "" "$INSTDIRACDSee.exe"
WriteRegStr HKLM "SOFTWAREMicrosoftWindowsCurrentVersionApp PathsACDSee.exe" Path $INSTDIR
WriteRegStr HKLM "SOFTWAREMicrosoftWindowsCurrentVersionApp PathsPELite.exe" "" "$INSTDIRPELite.exe"
WriteRegStr HKLM "SOFTWAREMicrosoftWindowsCurrentVersionApp PathsPELite.exe" Path $INSTDIR
WriteRegStr HKLM "SOFTWAREMicrosoftWindowsHelp" ACDSee.hlp $INSTDIR
WriteRegDWORD HKCU "SoftwareACD SystemsACDSeeTip" StartUp 1
WriteRegBin HKCU "SoftwareACD SystemsACDSeeCS" RememberDir 01
DeleteRegValue HKCR "SystemFileAssociationsimageShellExContextMenuHandlersShellImagePreview" ""
;注册信息
ReadINIStr $0 "$PLUGINSDIRACDSee.ini" "Field 3" "State"
WriteRegStr HKLM "SOFTWAREACD SystemsACDSeeCS" LicenseNumber $0
ReadINIStr $0 "$PLUGINSDIRACDSee.ini" "Field 7" "State"
WriteRegStr HKLM "SOFTWAREACD SystemsACDInTouch" UserName $0
ReadINIStr $0 "$PLUGINSDIRACDSee.ini" "Field 9" "State"
WriteRegStr HKLM "SOFTWAREACD SystemsACDInTouch" CompanyName $0
ReadINIStr $0 "$PLUGINSDIRACDSee.ini" "Field 11" "State"
WriteRegStr HKLM "SOFTWAREACD SystemsACDInTouch" UserEMail $0
SectionEnd
Section "ACD 图像编辑器"
#File "/oname=$INSTDIRPELite.exe" ".includePELite.exe"
SectionEnd
Section PicaView
SetOverwrite try
#File "/oname=$INSTDIRPicaView.dll" ".includePicaView.dll"
SetOverwrite on
WriteRegBin HKCU "SoftwareACD SystemsPicaView" CheckAllExtensions 00000000
WriteRegBin HKCU "SoftwareACD SystemsPicaView" PlaySounds 00
WriteRegBin HKCU "SoftwareACD SystemsPicaView" ShowFileSize 01000000
WriteRegStr HKLM "SoftwareACD SystemsPicaView" LicenseNumber 078723450172918441
ReadINIStr $0 "$PLUGINSDIRACDSee.ini" "Field 7" "State"
WriteRegStr HKLM "SoftwareACD SystemsPicaView" UserName $0
WriteRegStr HKLM "SoftwareACD SystemsPicaView" PIFolder "$INSTDIRPlugIns"
WriteRegStr HKCR "CLSID{68f32140-2ca3-11d0-acc1-444553540000}" "" "PicaView 外壳扩展"
WriteRegStr HKCR "CLSID{68f32140-2ca3-11d0-acc1-444553540000}InProcServer32" "" "$INSTDIRpicaview.dll"
WriteRegStr HKCR "CLSID{68f32140-2ca3-11d0-acc1-444553540000}InProcServer32" ThreadingModel Apartment
WriteRegStr HKCR "PicaViewImageShellOpenCommand" "" 'rundll32 "$INSTDIRpicaview.dll,showimage %1"'
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionShell ExtensionsApproved" "{68f32140-2ca3-11d0-acc1-444553540000}" "PicaView"
SectionEnd
SubSection /e "扩展图形格式支持插件"
Section "图标和光标格式" ico
#File ".includepluginsID_ICO.apl"
SectionEnd
Section "PhotoShop 图像" psd
#File ".includepluginsIDE_PSD.apl"
SectionEnd
Section "Paint Shop Pro 图像" psp
#File ".includepluginsID_PSP.apl"
SectionEnd
Section "SGI 图像" sgi
#File ".includepluginsIDE_SGI.apl"
SectionEnd
Section "Kodak Photo 图像" pcd
#File ".includepluginsID_PhotoCD.apl"
SectionEnd
Section "JPEG 2000" jp2
#File ".includepluginsIDE_JP2.apl"
SectionEnd
Section "数码相机 RAW 插件" raw
#File ".includepluginsID_DCRaw.apl"
SectionEnd
Section
SectionEnd
Section "ICN 图标支持插件" icn
#File ".includepluginsID_ICN.apl"
SectionEnd
SubSectionEnd
SubSection /e "功能扩展插件"
Section "无损 JPEG 旋转"
#File ".includepluginsCX_JPEGTrans.apl"
SectionEnd
Section "HTML 像册生成器" cx_html
#File ".includepluginsCX_HTML.apl"
#File ".includepluginsCX_HTML.chm"
#File ".includepluginsacdcp.dll"
SectionEnd
Section "图册实用工具" cx_csheet
#File ".includepluginsCX_ContactSheet.apl"
#File ".includepluginsCX_ContactSheet.chm"
SectionEnd
Section "调整层次"
#File ".includepluginsCX_AdjustLevels.apl"
SectionEnd
SubSectionEnd
SubSection /e "压缩文档支持插件"
Section ZIP zip
#File ".includepluginsAM_ZIP.apl"
SectionEnd
Section /o LHA lha
#File ".includepluginsAM_LHA.apl"
SectionEnd
Section /o RAR rar
#File ".includepluginsAM_RAR.apl"
SectionEnd
SubSectionEnd
Section "-post" post
;桌面快捷方式
ReadINIStr $0 "$PLUGINSDIRACDSee.ini" "Field 13" "State"
${If} $0 == 1
CreateShortCut "$DESKTOPACDSee 3.1.lnk" "$INSTDIRACDSee.exe"
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" Desktop 1
${EndIf}
;开始菜单
ReadINIStr $0 "$PLUGINSDIRACDSee.ini" "Field 14" "State"
${If} $0 == 1
CreateDirectory "$SMPROGRAMSACDSee"
CreateShortCut "$SMPROGRAMSACDSeeACDSee 3.1.lnk" "$INSTDIRACDSee.exe"
CreateShortCut "$SMPROGRAMSACDSee卸载.lnk" "$INSTDIRuninstall.exe"
CreateShortCut "$SMPROGRAMSACDSee帮助文档.lnk" "$INSTDIRACDSee.hlp"
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" StartMenu 1
${EndIf}
;快速启动
ReadINIStr $0 "$PLUGINSDIRACDSee.ini" "Field 15" "State"
${If} $0 == 1
CreateShortCut "$QUICKLAUNCHACDSee 3.1.lnk" "$INSTDIRACDSee.exe"
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" QuickLaunch 1
${EndIf}
WriteUninstaller "$INSTDIRuninstall.exe"
LogSet off
;目录右键菜单
ReadINIStr $0 "$PLUGINSDIRACDSee.ini" "Field 20" "State"
${If} $0 == 1
WriteRegStr HKCR "DirectoryshellACDBrowse" "" "用 ACDSee 浏览"
WriteRegStr HKCR "DirectoryshellACDBrowsecommand" "" '"$INSTDIRACDSee.exe" "%1"'
WriteRegStr HKCR "DriveshellACDBrowse" "" "用 ACDSee 浏览"
WriteRegStr HKCR "DriveshellACDBrowsecommand" "" '"$INSTDIRACDSee.exe" "%1"'
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" ContextMenu 1
${EndIf}
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" "DisplayName" "$(^NameDA)"
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" UninstallString "$INSTDIRuninstall.exe"
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" DisplayIcon "$INSTDIRACDSee.exe"
${StrCase} $0 '$INSTDIR' "U"
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" "InstallDir" $0
SectionEnd
Section "Association" association
SectionEnd
Section "Windows 和 OS/2 位图(bmp,dib,rle,wbmp)"
!insertmacro ASSOC bmp "$INSTDIRPlugInsIDE_ACDStd.apl,1"
!insertmacro ASSOC dib "$INSTDIRPlugInsIDE_ACDStd.apl,1"
!insertmacro ASSOC rle "$INSTDIRPlugInsIDE_ACDStd.apl,1"
!insertmacro ASSOC wbmp "$INSTDIRPlugInsIDE_ACDStd.apl,11"
SectionEnd
Section "增强图元文件格式(emf)"
!insertmacro ASSOC emf "$INSTDIRPlugInsIDE_ACDStd.apl,2"
SectionEnd
Section "图形交换格式(gif)"
!insertmacro ASSOC gif "$INSTDIRPlugInsIDE_ACDStd.apl,3"
SectionEnd
Section "标准 JPEG(jpg,jpeg,jpe,jif,jfif)"
!insertmacro ASSOC jpg "$INSTDIRPlugInsIDE_ACDStd.apl,4"
!insertmacro ASSOC jpeg "$INSTDIRPlugInsIDE_ACDStd.apl,4"
!insertmacro ASSOC jpe "$INSTDIRPlugInsIDE_ACDStd.apl,4"
!insertmacro ASSOC jif "$INSTDIRPlugInsIDE_ACDStd.apl,4"
!insertmacro ASSOC jfif "$INSTDIRPlugInsIDE_ACDStd.apl,4"
SectionEnd
Section "ZSoft 出版画笔(pcx,dcx)"
!insertmacro ASSOC pcx "$INSTDIRPlugInsIDE_ACDStd.apl,5"
!insertmacro ASSOC dcx "$INSTDIRPlugInsIDE_ACDStd.apl,5"
SectionEnd
Section "便携网络图形(png)"
!insertmacro ASSOC png "$INSTDIRPlugInsIDE_ACDStd.apl,6"
SectionEnd
Section "Targa TGA(tga)"
!insertmacro ASSOC tga "$INSTDIRPlugInsIDE_ACDStd.apl,7"
SectionEnd
Section "Tag 图片文件格式(tif,tiff,xif)"
!insertmacro ASSOC tif "$INSTDIRPlugInsIDE_ACDStd.apl,8"
!insertmacro ASSOC tiff "$INSTDIRPlugInsIDE_ACDStd.apl,8"
!insertmacro ASSOC xif "$INSTDIRPlugInsIDE_ACDStd.apl,8"
SectionEnd
Section "Windows 3.x 图元文件格式(wmf)"
!insertmacro ASSOC wmf "$INSTDIRPlugInsIDE_ACDStd.apl,9"
SectionEnd
Section "Pegasus PIC 格式(pic)"
SectionIn 1 2
!insertmacro ASSOC pic "$INSTDIRPlugInsIDE_ACDStd.apl,10"
SectionEnd
Section "图标格式(ico,cur,ani)" ${ico}
!insertmacro ASSOC ico "%1"
!insertmacro ASSOC cur "%1"
!insertmacro ASSOC ani "%1"
SectionEnd
Section "PhotoShop 图像格式(psd)" ${psd}
!insertmacro ASSOC psd "$INSTDIRPlugInsIDE_PSD.apl,0"
SectionEnd
Section "Paint Shop Pro 图像格式(pspimage,psp,pspframe,pspshape,psptube,tub)" ${psp}
!insertmacro ASSOC psp "$INSTDIRPlugInsID_PSP.apl,0"
!insertmacro ASSOC_TYPE pspimage PSP
!insertmacro ASSOC_TYPE pspframe PSP
!insertmacro ASSOC_TYPE pspshape PSP
!insertmacro ASSOC_TYPE psptube PSP
!insertmacro ASSOC_TYPE tub PSP
SectionEnd
Section "SGI 图像格式(sgi)" ${sgi}
!insertmacro ASSOC sgi "$INSTDIRPlugInsIDE_SGI.apl,0"
SectionEnd
Section "Kodak Photo 图像格式(pcd)" ${pcd}
!insertmacro ASSOC pcd "$INSTDIRPlugInsID_PhotoCD.apl,0"
SectionEnd
Section "JPEG 2000(jp2)" ${jp2}
!insertmacro ASSOC jp2 "$INSTDIRPlugInsIDE_JP2.apl,0"
!insertmacro ASSOC jpc "$INSTDIRPlugInsIDE_JP2.apl,0"
SectionEnd
Section "数码相机 RAW 格式图像" ${raw}
!insertmacro ASSOC raw "$INSTDIRPlugInsID_DCRaw.apl,0"
!insertmacro ASSOC cr2 "$INSTDIRPlugInsID_DCRaw.apl,1"
!insertmacro ASSOC crw "$INSTDIRPlugInsID_DCRaw.apl,2"
!insertmacro ASSOC dcr "$INSTDIRPlugInsID_DCRaw.apl,3"
!insertmacro ASSOC mrw "$INSTDIRPlugInsID_DCRaw.apl,4"
!insertmacro ASSOC nef "$INSTDIRPlugInsID_DCRaw.apl,5"
!insertmacro ASSOC orf "$INSTDIRPlugInsID_DCRaw.apl,6"
!insertmacro ASSOC pef "$INSTDIRPlugInsID_DCRaw.apl,7"
!insertmacro ASSOC raf "$INSTDIRPlugInsID_DCRaw.apl,8"
!insertmacro ASSOC tiff "$INSTDIRPlugInsID_DCRaw.apl,9"
!insertmacro ASSOC x3f "$INSTDIRPlugInsID_DCRaw.apl,10"
SectionEnd
Section "ICN 图标(icn)" ${icn}
!insertmacro ASSOC icn "$INSTDIRPlugInsID_ICN.apl,0"
SectionEnd
Section "ZIP (右键菜单)" ${zip}
!insertmacro ASSOC_ARCHIVE zip "$INSTDIRPlugInsAM_ZIP.apl"
SectionEnd
Section "LHA (右键菜单)" ${lha}
!insertmacro ASSOC_ARCHIVE lha "$INSTDIRPlugInsAM_LHA.apl"
SectionEnd
Section "RAR (右键菜单)" ${rar}
!insertmacro ASSOC_ARCHIVE rar "$INSTDIRPlugInsAM_RAR.apl"
SectionEnd
Section "End" end
SectionEnd
!ifdef DEBUG
Section
Push "$PLUGINSDIRdebug.txt"
Call DumpLog
ExecShell open "$PLUGINSDIRdebug.txt" "" SW_SHOWMAXIMIZED
Sleep 1000
SectionEnd
Function DumpLog
Exch $R5
Push $R0
Push $R1
Push $R2
Push $R3
Push $R4
Push $R6
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1016
StrCmp $R0 0 exit
FileOpen $R5 $R5 "a"
FileSeek $R5 0 END
StrCmp $R5 "" exit
SendMessage $R0 0x1004 0 0 $R6
System::Alloc ${NSIS_MAX_STRLEN}
Pop $R3
StrCpy $R2 0
System::Call "*(i, i, i, i, i, i, i, i, i) i
(0, 0, 0, 0, 0, R3, ${NSIS_MAX_STRLEN}) .R1"
loop: StrCmp $R2 $R6 done
System::Call "User32::SendMessageA(i, i, i, i) i
($R0, 0x102D, $R2, R1)"
System::Call "*$R3(&t${NSIS_MAX_STRLEN} .R4)"
FileWrite $R5 "$R4"
FileWriteByte $R5 13
FileWriteByte $R5 10
IntOp $R2 $R2 + 1
Goto loop
done:
FileClose $R5
System::Free $R1
System::Free $R3
exit:
Pop $R6
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Pop $R0
Pop $R5
FunctionEnd
!endif
;**********************************************************************
Function .onInit
InitPluginsDir
#File "/oname=$PLUGINSDIRacdsee.ini" ".resourceacdsee.ini"
#File "/oname=$PLUGINSDIRgaydata.ini" ".resourcegaydata.ini"
System::Call "advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2"
WriteINIStr "$PLUGINSDIRacdsee.ini" "Field 7" "State" $0
ReadRegStr $0 HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" "InstallDir"
${If} $0 != ""
ReadRegStr $0 HKLM "SOFTWAREACD SystemsACDSeeCS" LicenseNumber
WriteINIStr "$PLUGINSDIRacdsee.ini" "Field 3" "State" $0
ReadRegStr $0 HKLM "SOFTWAREACD SystemsACDInTouch" UserName
WriteINIStr "$PLUGINSDIRacdsee.ini" "Field 7" "State" $0
ReadRegStr $0 HKLM "SOFTWAREACD SystemsACDInTouch" CompanyName
WriteINIStr "$PLUGINSDIRACDSee.ini" "Field 9" "State" $0
ReadRegStr $0 HKLM "SOFTWAREACD SystemsACDInTouch" UserEMail
WriteINIStr "$PLUGINSDIRacdsee.ini" "Field 11" "State" $0
ReadRegStr $0 HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" Desktop
WriteINIStr "$PLUGINSDIRacdsee.ini" "Field 13" "State" $0
ReadRegStr $0 HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" StartMenu
WriteINIStr "$PLUGINSDIRacdsee.ini" "Field 14" "State" $0
ReadRegStr $0 HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" QuickLaunch
WriteINIStr "$PLUGINSDIRacdsee.ini" "Field 15" "State" $0
ReadRegStr $0 HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee" ContextMenu
WriteINIStr "$PLUGINSDIRacdsee.ini" "Field 20" "State" $0
${EndIf}
FunctionEnd
Function CheckDependence
!insertmacro SelectIfSet ${ico}
!insertmacro SelectIfSet ${psd}
!insertmacro SelectIfSet ${psp}
!insertmacro SelectIfSet ${sgi}
!insertmacro SelectIfSet ${pcd}
!insertmacro SelectIfSet ${jp2}
!insertmacro SelectIfSet ${icn}
!insertmacro SelectIfSet ${zip}
!insertmacro SelectIfSet ${lha}
!insertmacro SelectIfSet ${rar}
!insertmacro SelectIfSet ${raw}
FunctionEnd
Function ComponentPre
Push $0
Push $1
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1017
ShowWindow $1 ${SW_HIDE}
Call ResetSectionText
;隐藏 Asscoiations
${For} $0 ${association} ${end}
SectionSetText $0 ""
${Next}
;HTML 像册生成器 和 图册实用工具 在 2000、98 下无法使用
ReadRegStr $0 HKLM "SOFTWAREMicrosoftWindows NTCurrentVersion" CurrentVersion
${If} $0 == ""
${OrIf} $0 == "5.0"
!insertmacro UnselectSection ${cx_html}
!insertmacro UnselectSection ${cx_csheet}
SectionSetText ${cx_html} ""
SectionSetText ${cx_csheet} ""
${EndIf}
Pop $1
Pop $0
FunctionEnd
Function ComponentShow
Push $0
Push $1
${For} $1 ${main} ${post}
ReadINIStr $0 "$PLUGINSDIRgaydata.ini" "secnames" "sec$1"
SectionSetText $1 $0
${Next}
Pop $1
Pop $0
FunctionEnd
Function AsscoiationPre
Push $0
Push $1
Call ResetSectionText
;隐藏 Components
${For} $0 ${main} ${post}
SectionSetText $0 ""
${Next}
Call CheckDependence
Pop $1
Pop $0
FunctionEnd
Function AsscoiationShow
Push $0
Push $1
${For} $1 ${association} ${end}
ReadINIStr $0 "$PLUGINSDIRgaydata.ini" "secnames" "sec$1"
SectionSetText $1 $0
${Next}
Pop $1
Pop $0
FunctionEnd
Function ResetSectionText
Push $R0
Push $R1
${For} $R1 ${main} ${end}
ReadINIStr $R0 "$PLUGINSDIRgaydata.ini" "secnames" "sec$R1"
${If} $R0 == ""
SectionSetText $R1 ""
${Else}
SectionSetText $R1 " "
${EndIf}
${Next}
Pop $R1
Pop $R0
FunctionEnd
Function SetCustom
InstallOptions::initDialog /NOUNLOAD $PLUGINSDIRacdsee.ini
!insertmacro MUI_HEADER_TEXT "个性化设置" "请输入你需要定制的个人信息"
InstallOptions::show
FunctionEnd
Function ChageFONT
GetDlgItem $0 $MUI_HWND 1201
CreateFont $1 "Tahoma" "11" "700"
SendMessage $0 ${WM_SETFONT} $1 0
FunctionEnd
;******************************************************
; 卸载段
;******************************************************
Section Uninstall
Call un.Restore
FindWindow $0 "Afx:400000:8"
SendMessage $0 ${WM_CLOSE} 0 0
Call un.DelReg
Push "$INSTDIRinstall.log"
Call un.DelFileByLog
Push "$INSTDIRinstall.log"
Call un.RMDirByLog
Delete "$INSTDIRinstall.log"
RMDir "$INSTDIR"
System::Call 'shell32.dll::SHChangeNotify(l, l, i, i) v (0x08000000, 0, 0, 0)'
${If} ${RebootFlag}
MessageBox MB_YESNO|MB_ICONEXCLAMATION "某个文件需要重启后才能删除,现在重新启动吗?" IDNO +2
Reboot
${ElseIf} ${FileExists} $INSTDIR
MessageBox MB_OK|MB_ICONINFORMATION "某些文件并不是安装程序产生的,因此需要你手动删除"
ExecShell open $INSTDIR SW_SHOWMAXIMIZED
${EndIf}
SectionEnd
Function un.Restore
Push $R0
Push $R1
Push $R2
Push $R3
StrCpy $R0 0
loop:
EnumRegValue $R1 HKCR "ACDSee.FILE" $R0
ReadRegStr $R3 HKCR ".$R1UndoClass" ""
StrCmp $R1 "" loop_quit
StrCmp $R3 "" 0 restore                ;如果备份的是空值则直接删除
DeleteRegKey HKCR ".$R1"
DeleteRegKey HKCR "ACDSee.$R1"
DetailPrint ".$R1 文件关联已被移除"
Goto cont_restore
restore:
ReadRegStr $R2 HKCR ".$R1" ""
StrCpy $R2 $R2 7
StrCmp $R2 "ACDSee." 0 no_restore
WriteRegStr HKCR ".$R1" "" "$R3"
DeleteRegKey HKCR "ACDSee.$R1"
DetailPrint ".$R1 文件关联已被恢复"
Goto cont_restore
no_restore:
DetailPrint ".$R1 未被关联到 ACDSee,略过"
cont_restore:
IntOp $R0 $R0 + 1
Goto loop
loop_quit:
StrCpy $R0 0 ;清除关联的压缩文档
loop2:
EnumRegValue $R1 HKCR ACDSee.FileArchive $R0
StrCmp $R1 "" loop2_quit
EnumRegKey $R2 HKCR $R1 0
StrCmp $R2 "" +2
DeleteRegKey HKCR $R1
IntOp $R0 $R0 + 1
Goto loop2
loop2_quit:
DeleteRegKey HKCR .apl
DeleteRegKey HKCR ACD.PlugIn
DeleteRegKey HKCR ACDSee.FILE
Pop $R3
Pop $R2
Pop $R1
Pop $R0
FunctionEnd
Function un.DelFileByLog
Exch $R0
Push $R1
Push $R2
Push $R3
FileOpen $R0 $R0 r
${Do}
FileRead $R0 $R1
StrCpy $R1 $R1 -2
StrCpy $R2 $R1 11
StrCpy $R3 $R1 20
${If} $R2 == "File: wrote"
${OrIf} $R2 == "File: skipp"
${OrIf} $R3 == "CreateShortCut: out:"
${OrIf} $R3 == "created uninstaller:"
Push $R1
Push '"'
Call un.StrLoc
Pop $R2
${If} $R2 != ""
IntOp $R2 $R2 + 1
StrCpy $R3 $R1 "" $R2
Push $R3
Push '"'
Call un.StrLoc
Pop $R2
${If} $R2 != ""
StrCpy $R3 $R3 $R2
Delete /REBOOTOK $R3
${EndIf}
${EndIf}
${EndIf}
StrCpy $R2 $R1 7
${If} $R2 == "Rename:"
Push $R1
Push '->'
Call un.StrLoc
Pop $R2
${If} $R2 != ""
IntOp $R2 $R2 + 2
StrCpy $R3 $R1 "" $R2
Delete /REBOOTOK $R3
${EndIf}
${EndIf}
${LoopUntil} $R1 == ""
FileClose $R0
Pop $R3
Pop $R2
Pop $R1
Pop $R0
FunctionEnd
Function un.RMDirByLog
Exch $R0
Push $R1
Push $R2
Push $R3
Push $R4
FileOpen $R0 $R0 r
FileSeek $R0 16 END $R1
${Do}
FileSeek $R0 -3 CUR $R1
FileReadByte $R0 $R2
FileReadByte $R0 $R3
${If} "$R2$R3" == "1310"
FileRead $R0 $R2
FileSeek $R0 $R1
StrCpy $R3 $R2 16
${If} $R3 == "CreateDirectory:"
Push $R2
Push '"'
Call un.StrLoc
Pop $R3
${If} $R3 != ""
IntOp $R3 $R3 + 1
StrCpy $R3 $R2 "" $R3
Push $R3
Push '"'
Call un.StrLoc
Pop $R2
${If} $R2 != ""
StrCpy $R2 $R3 $R2
; ----------------------特殊目录则跳过
${If} $R2 != $PLUGINSDIR
${AndIf} $R2 != $PROGRAMFILES
${AndIf} $R2 != $COMMONFILES
${AndIf} $R2 != $DESKTOP
${AndIf} $R2 != $STARTMENU
${AndIf} $R2 != $SMPROGRAMS
${AndIf} $R2 != $SMSTARTUP
${AndIf} $R2 != $QUICKLAUNCH
${AndIf} $R2 != $FAVORITES
RMDir $R2 ;如果是空目录则删除
${EndIf}
; ----------------------
${EndIf}
${EndIf}
${EndIf}
${EndIf}
${LoopUntil} $R1 < 10
FileClose $R0
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Pop $R0
FunctionEnd
Function un.StrLoc
Exch $R0 ;Str to search for
Exch
Exch $R1 ;string
Push $R2 ;len of Str to search for
Push $R3 ;len of string
Push $R4
Push $R5
StrLen $R2 $R0
StrLen $R3 $R1
${Do}
StrCpy $R5 $R1 $R2 $R4
${If} $R5 == $R0
${OrIf} $R4 = $R3
${ExitDo}
${EndIf}
IntOp $R4 $R4 + 1
${Loop}
${If} $R4 = $R3
StrCpy $R0 ""
${Else}
StrCpy $R0 $R4
${EndIf}
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
Function un.DelReg
ReadRegStr $0 HKCR "CLSID{68f32140-2ca3-11d0-acc1-444553540000}" ""
${If} $0 != ""
DeleteRegKey HKCU "SoftwareACD SystemsPicaView"
DeleteRegKey HKLM "SoftwareACD SystemsPicaView"
DeleteRegKey HKCR "CLSID{68f32140-2ca3-11d0-acc1-444553540000}"
DeleteRegKey HKCR "PicaViewImage"
DeleteRegValue HKCR "*shellexContextMenuHandlersPicaView" ""
DeleteRegValue HKLM "SoftwareMicrosoftWindowsCurrentVersionShell ExtensionsApproved" "{68f32140-2ca3-11d0-acc1-444553540000}"
${EndIf}
DeleteRegValue HKLM "SOFTWAREACD SystemsACDSee" InstallationDate
DeleteRegValue HKLM "SOFTWAREACD SystemsACDSee" InTouchSettings
DeleteRegValue HKLM "SOFTWAREACD SystemsACDSee" LicenseNumber
DeleteRegValue HKLM "SOFTWAREACD SystemsACDSee" ServerList
DeleteRegValue HKLM "SOFTWAREACD SystemsACDSee" UsageCount
DeleteRegKey /ifempty HKLM "SOFTWAREACD SystemsACDSee"
DeleteRegKey /ifempty HKLM "SOFTWAREACD Systems"
DeleteRegKey HKCU "SOFTWAREACD SystemsPlugInsV1"
DeleteRegKey HKCU "SOFTWAREACD SystemsPicaView"
DeleteRegKey HKLM "SOFTWAREACD SystemsPlugInsV1"
DeleteRegKey HKLM "SOFTWAREACD SystemsPicaView"
DeleteRegKey HKLM "SOFTWAREACD SystemsACDInTouch"
DeleteRegKey HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstallACDSee"
FunctionEnd
© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容