|
本帖最后由 ddsony 于 2014-11-5 10:12 编辑
M大程序包里“命令行挂载外置——统一便捷版”压缩包里有的,UDM+Fixdrv.wcs:
///////安装Imdisk
_SUB InsImdisk
SET-def ImdiskVerMin=0x160
RAMD ImDisk*&&V --version
SED &V=0,\., ,%V%
MSTR &&hv1,&&lv1,&&err=<1><2><5>%V%
FIND $%lv1%=, TEAM SET hv1=0
CALC -base=16 #&&ImdiskVer=0x%hv1% * 0x100 + 0x%lv1%
FIND $%err%<>, SET ImdiskVer=0
FIND $%1=, IFEX $%ImdiskVer%>=%ImdiskVerMin%, TEAM ImDiskAddReg| EXIT
QDEVI $$..\inf\imdisk.inf
ImDiskAddReg
//SERV imdsksvc
SERV awealloc
SERV imdisk
_END
处理Imdisk程序注册表项:
_SUB ImDiskAddRegNom
SET &sMyName=%MyName%
MSTR &&v1=<1>%sMyname%
FIND $%v1%<>%sMyname%, SET sMyname="%MyName%"
REGI HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ImDisk\DisplayName=ImDisk Virtual Disk Driver
REGI HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ImDisk\DisplayVersion=1.*
REGI HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ImDisk\UninstallString=uninstall_imdisk.cmd
REGI HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ImDisk\DisplayIcon=%SystemRoot%\System32\imdisk.cpl
REGI HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ImDisk\EstimatedSize=#320
REGI HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ImDisk\Size=""
REGI HKCR\*\shell\ImDiskMountFile\\=加载到 ImDisk 虚拟磁盘
IFEX $%PECMDVER%<201201880400, REGI HKCR\*\shell\ImDiskMountFile\command\\=rundll32.exe imdisk.cpl,RunDLL_MountFile %%L
IFEX $%PECMDVER%>=201201880400, REGI HKCR\*\shell\ImDiskMountFile\command\\=%sMyname% CALL $--win --qd@ imdisk.cpl,RunDLL_MountFile,%%L
REGI HKCR\Drive\shell\ImDiskUnmount\\=卸载 ImDisk 虚拟磁盘
IFEX $%PECMDVER%<201201880400, REGI HKCR\Drive\shell\ImDiskUnmount\command\\=rundll32.exe imdisk.cpl,RunDLL_RemoveDevice %%L
IFEX $%PECMDVER%>=201201880400, REGI HKCR\Drive\shell\ImDiskUnmount\command\\=%sMyname% CALL $--win --qd@ imdisk.cpl,RunDLL_RemoveDevice,%%L
REGI HKCR\Drive\shell\ImDiskSaveImage\\=将磁盘内容保存到映像文件
IFEX $%PECMDVER%<201201880400, REGI HKCR\Drive\shell\ImDiskSaveImage\command\\=rundll32.exe imdisk.cpl,RunDLL_SaveImageFile %%L
IFEX $%PECMDVER%>=201201880400, REGI HKCR\Drive\shell\ImDiskSaveImage\command\\=%sMyname% CALL $--win --qd@ imdisk.cpl,RunDLL_SaveImageFile,%%L
//ImDiskDelOldReg
REGI HKCR\*\shell\ImDiskMountFileWriteable\!
_END
处理Imdisk超级右键菜单注册表项:
_SUB ImDiskAddRegSuper
EXEC -nfb =%MyName% CALL $ImdiskMenuExt.dll
IFEX $%PECMDVER%<201201880400, TEAM SET &F=rundll32.exe| SET &D= ! TEAM SET &F=%&Myname% CALL $--win --qd@ | SET &FG=,
// 删除Imdisk旧的死板菜单
REGI HKEY_CLASSES_ROOT\Drive\Shell\ImDiskUnmount\!
REGI HKEY_CLASSES_ROOT\Drive\Shell\ImDiskSaveImage\!
REGI $HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved\{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}="ImdiskMenuExt"
SET &PECMDDLL=
IFEX %SystemRoot%\System32\PECMD.DLL, SET PECMDDLL=PECMD.DLL
IFEX .\PECMD.DLL, SET PECMDDLL=%%~dps?\PECMD.DLL
SET cmd1=*cmd /c %%~dps?\CheckImdiskMenuExt.cmd %%L
SET CMD2=CALL $**c **1 %PECMDDLL%,main,TEAM ENVI^ ForceLocal=1| SET R=1| RAMD Imdisk*V -l -m %%L| FIND $%%V%%<>, SET R=0xFFF| EXIT= %%R%%
SET _cmd=
FIND $"%PECMDDLL%"<>"", SET _cmd=%cmd2%
IFEX CheckImdiskMenuExt.cmd, SET _cmd=%cmd1%
REGI $HKEY_CLASSES_ROOT\SM{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}\MENU\check=%_cmd%
//不注释下面这行,就是子菜单
//REGI $HKEY_CLASSES_ROOT\SM{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}\MENU\001menu=>Imdisk
REGI $HKEY_CLASSES_ROOT\SM{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}\MENU\002menu=将磁盘内容保存到映像文件
REGI $HKEY_CLASSES_ROOT\SM{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}\MENU\002help=将磁盘内容保存到映像文件
REGI $HKEY_CLASSES_ROOT\SM{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}\MENU\002cmd=%F% imdisk.cpl,RunDLL_SaveImageFile%FG%%%L
REGI $HKEY_CLASSES_ROOT\SM{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}\MENU\003menu=卸载 ImDisk 虚拟磁盘
REGI $HKEY_CLASSES_ROOT\SM{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}\MENU\003help=卸载 ImDisk 虚拟磁盘
//REGI $HKEY_CLASSES_ROOT\SM{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}\MENU\003cmd=%F% imdisk.cpl,RunDLL_RemoveDevice%FG%%%L
REGI $HKEY_CLASSES_ROOT\SM{A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}\MENU\003cmd=%&MyName% TEAM RAMD Imdisk* -d -m %%L| WAIT 100| SET &YESNO=| IFEX %%L, MESS 需要强制卸载 %%L 吗?#YN *10000 $N| FIND $%%&&YESNO%%=YES, RAMD Imdisk* -D -m %%L| WAIT 100| FIND $%%&&YESNO%%=YES, IFEX %%L, MESS 强制卸载 %%L 失败*8000
//菜单关联的对象(Drive, txtfile wimfile...)
REGI $HKEY_CLASSES_ROOT\Drive\ShellEx\ContextMenuHandlers\ImdiskMenuExt\\={A2CBD8C7-26FA-49AA-A296-68D9DA72A2F0}
//ImDiskDelOldReg
REGI HKCR\*\shell\ImDiskMountFileWriteable\!
_END
_SUB ImDiskAddReg
//ImDiskAddRegNom
ImDiskAddRegSuper
_END
|
|