shell extensions - WiX equivalent of "Regasm.exe my.dll /codebase"? -
codeproject has great windows shell extension tutorial.
compile, run regasm.exe csshellextcontextmenuhandler.dll /codebase, , shell extension available, works great.
but asking users run regasm not user-friendly, wrote small wix script below. (just copied output of heat, plus dependency dll want use).
problem: when install resulting msi, shell extension not appear (in windows explorer, right-clicking on file not show item, despite working regasm)
<?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> i tried change root="hkcr" key="[...]" root="hklm" key="software\classes\[...]", mimic keys regasm installs, not work either.
first, clsid using different original example source. perhaps edited make own. make sure using same value attribute on filecontextmenuext class.
wix's heat.exe doesn't seem support codebase element. perhaps assumption since registering com assembly machine-wide, put in machine-wide assembly location (i.e., gac). if do, codebase won't required.
heat file ... generate except codebase element you've entered hand, see. have other required registration entry, *\shellex\contextmenuhandlers. it's application-specific element can't generated. but, entered hand.
finally, installer , explorer.exe have have same "bit-ness." otherwise, installer might make registry entries 32-bit explorer.exe 64-bit explorer.exe won't see them. deploy product, you'll have have x86 , x64 build of installer. can explicitly set platform package in wix/product/package element.
other that, product.wxs "works on machine."
Comments
Post a Comment