CodeProject의 코드는 Windows shell extension tutorial입니다.WiX에 해당하는 "Regasm.exe my.dll/codebase"?
컴파일, 실행 Regasm.exe CSShellExtContextMenuHandler.dll /codebase
및 셸 확장을 사용할 수 있습니다, 그것은 잘 작동합니다.
그러나 사용자에게 Regasm
을 실행하도록 요청하는 것은 사용자에게 친숙하지 않으므로 아래에있는 작은 WiX 스크립트를 작성했습니다. (단지 heat
의 출력과 함께 사용하려는 종속성 DLL을 복사했습니다.)
문제 : 나는 결과 MSI를 설치하면 (이 Regasm
작업에도 불구하고, 내 항목을 표시하지 않습니다 Windows 탐색기에서 파일을 마우스 오른쪽 버튼으로 클릭에)는, 쉘 확장이 표시되지 않는
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='HelloWorld Shell Extension' Id='2afd44ab-16d7-40f4-8741-69ad546cb7cf' UpgradeCode='c5139d19-21ba-43c6-a17d-68760331f332'
Language='1033' Codepage='1252' Version='0.4.4' Manufacturer='Me'>
<Package Id='*' Keywords='Installer' Description="HelloWorld Shell Extension Setup" Manufacturer='Me'
InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='HelloWorldShellExtension.cab' EmbedCab='yes' DiskPrompt='HelloWorld CAB' />
<Property Id='DiskPrompt' Value="HelloWorldShellExtension Bundle CAB Installation" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='INSTALLDIR' Name='HelloWorldShellExtension'>
<Component Id="cmpB0970E4FB9610FC20E1C6B6B2D45C606" Guid="7044db96-17d3-4d4f-93b0-135b89b042c8">
<Class Id="{CE43A2AB-B457-49BF-C83F-4306208D438B}" Context="InprocServer32" Description="CSShellExtContextMenuHandler.FileContextMenuExt" ThreadingModel="both" ForeignServer="mscoree.dll">
<ProgId Id="CSShellExtContextMenuHandler.FileContextMenuExt" Description="CSShellExtContextMenuHandler.FileContextMenuExt" />
</Class>
<File Id="fil5B7C752C5541C807852A6781921F95AB" KeyPath="yes" Source="bin\CSShellExtContextMenuHandler.dll" />
<RegistryValue Root="HKCR" Key="*\shellex\ContextMenuHandlers\{ce43a2ab-b457-49bf-c83f-4306208d438b}" Value="CSShellExtContextMenuHandler.FileContextMenuExt Class" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32\1.0.0.0" Name="Class" Value="CSShellExtContextMenuHandler.FileContextMenuExt" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32\1.0.0.0" Name="Assembly" Value="CSShellExtContextMenuHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=73df467e0a99a326" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#fil5B7C752C5541C807852A6781921F95AB]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32" Name="Class" Value="CSShellExtContextMenuHandler.FileContextMenuExt" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32" Name="Assembly" Value="CSShellExtContextMenuHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=73df467e0a99a326" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32" Name="CodeBase" Value="file:///[#fil5B7C752C5541C807852A6781921F95AB]" Type="string" Action="write" />
</Component>
<Component Id='Libraries' Guid='f982a0bb-824d-4835-921d-e51b47b8598b'>
<File Id='dependency.dll' Name='dependency.dll' Source='bin\dependency.dll' DiskId='1' />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='HelloWorldShellExtensionFeature' Title='HelloWorld' Description='HelloWorld' Level='1' AllowAdvertise='no'>
<ComponentRef Id="cmpB0970E4FB9610FC20E1C6B6B2D45C606" />
<ComponentRef Id="Libraries" />
</Feature>
<UI>
<UIRef Id="WixUI_InstallDir" />
</UI>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
</Product>
</Wix>
Regasm이 실제로 설치하는 키를 모방하기 위해 Root="HKCR" Key="[...]"
을 Root="HKLM" Key="SOFTWARE\Classes\[...]"
으로 변경하려고했으나 작동하지 않습니다.