You really don't want to call regasm.exe from inside an MSI. What you really 
want to do is get all the necessary registry keys for your COM visible 
assembly. I haven't done this myself but looking at one of Rob's old examples 
you should be able to get these with the following command line:

regasm /tlb /reg MyAssembly.dll

That should create a file named MyAssembly.reg that will contain the registry 
keys you should add to your MSI.

Fredrik

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of pobox77
Sent: Friday, March 23, 2007 3:05 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] custom action to reg NET 2.0


Heureka!

    <InstallExecuteSequence>
      ...
      <Custom Action='CallRegASM' After='InstallFinalize'>NOT
Installed</Custom>
      <Custom Action='CallUnRegASM'
After='InstallInitialize'>Installed</Custom>
      ...
    </InstallExecuteSequence>

works.

I hope I have the right solution :)


pobox77 wrote:
>
> Hi,
>
> <CustomAction Id="CallRegASM" Directory="INSTALLDIR" Win64="no"
> ExeCommand="&quot;[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\regasm.exe&quot;
> /codebase &quot;[INSTALLDIR]MyAssembly.dll&quot;" Return="check" />
>
> works fine.
>
> To uninstall I would use
>
> <CustomAction Id="CallUnRegASM" Directory="INSTALLDIR" Win64="no"
> ExeCommand="&quot;[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\regasm.exe&quot;
> /unregister &quot;[INSTALLDIR]MyAssembly.dll&quot;" Return="check" />
>
> to unregister MyAssembly.dll. I suppose it should happen before the files
> are removed otherwise the dll will not be found.
>
> If I call regasm /unregister my.dll from command line it works.
>
> Where should I place the second CA in wxs to work by uninstalling
> and which attribute has to be used to have it working?
>
> I suppose:
>    <InstallExecuteSequence>
>       <LaunchConditions After="AppSearch" />
>       <Custom Action='CallRegASM' After='InstallFinalize'>NOT
> Installed</Custom>
>
> I suppose somewhere here:
>
>       <Custom Action='CallUnRegASM'
> After='CostFinalize'>Installed</Custom>
>
>
>       <RemoveExistingProducts After="InstallFinalize" />
>     </InstallExecuteSequence>
>
>  but it deliveres an error 2732
>
> Thanks in advance for any quick help,
> Peter
>
>
>
>
>
> pobox77 wrote:
>>
>> Hi Dhaval,
>>
>> Does uninstall work too?
>> I mean will the dll also deregistered if I uninstall the package?
>>
>> Thanks in advance,
>> Peter
>>
>>
>> Don Tasanasanta wrote:
>>>
>>> Your solution helped me find what was wrong with mine. For some reason
>>> the CA didn't like what I was putting in for the Directory value. I put
>>> in INSTALLDIR and everything worked great.
>>>
>>>
>>>
>>> Thanks!
>>>
>>>
>>>
>>> ________________________________
>>>
>>> From: Dhaval Patel [mailto:[EMAIL PROTECTED]
>>> Sent: Friday, March 09, 2007 4:59 PM
>>> To: Don Tasanasanta
>>> Subject: Re: [WiX-users] custom action to reg NET 2.0
>>>
>>>
>>>
>>> Here is one of my CustomAction elements that I have used in different
>>> projects - I don't see anything in your CA that will not allow it to
>>> work, but maybe you want to change the ExeCommand attribute to something
>>> like I have and give it a shot:
>>>
>>> <InstallExecuteSequence>
>>>
>>> <Custom Action='Installation' After='InstallFinalize'>NOT
>>> Installed</Custom>
>>>
>>> </InstallExecuteSequence>
>>>
>>> <CustomAction Id='Installation' Directory='INSTALLDIR' Win64='no'
>>>
>>> ExeCommand='"[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\regasm.ex
>>> e" /codebase "[ProgramFilesFolder]MyComapny\MyProduct\MyProduct.dll"'
>>>
>>>           Return='check' />
>>>
>>> This seems to work just fine (i.e. it successfully registers the .dll
>>> for COM Interop in the registry). I think I had the same issue that you
>>> are having, but I figured out the solution through trial and error, and
>>> then I forgot all about it :)
>>>
>>> The problem I think is that you may think WIX will execute the CA from
>>> within the "Directory" ([FRAMEWORKBASEPATH]v2.0.50727 in your case)
>>> attribute, but that probably is not the case. Notice in my case how I
>>> explicitly pass all the paths to the ExeCommand attribute directly - I
>>> don't even worry about the "Directory" attribute (I assume you can set
>>> it to any valid DirectoryId within your current WIX project, if you
>>> decide to use the technique I am using). This is probably the reason why
>>> it is working in my case, and not yours.
>>>
>>> Let us all know if this fixes your issue :)
>>>
>>>
>>>
>>>
>>> On 3/8/07, Don Tasanasanta <[EMAIL PROTECTED] > wrote:
>>>
>>> I have been banging my head against this all day... I'm trying to get
>>> aspnet_regiis.exe to run and set the ASPNET version to 2.0 for my
>>> virtual directory.
>>>
>>>
>>>
>>> Here is my custom action...
>>>
>>> <CustomAction Id="SetAspNet" Return="asyncWait"
>>> Directory="[FRAMEWORKBASEPATH]v2.0.50727" Execute="commit"
>>> ExeCommand="aspnet_regiis.exe -s W3SVC/1/ROOT/MYWebsite -norestart" />
>>>
>>>
>>>
>>> Where FRAMEWORKBASEPATH is the path to Framework under Microsoft.NET in
>>> the WINDOWS folder.
>>>
>>>
>>>
>>> I have also tried
>>>
>>>
>>>
>>> <CustomAction Id="VIA3AdminAspNet" Return="asyncWait"
>>> Property="[ASPNETREGPATH]" Execute="commit" ExeCommand="-s
>>> W3SVC/1/ROOT/MyWebsite -norestart" />
>>>
>>>
>>>
>>> Where ASPNETREGPATH is the entire path plus aspnet_regiis.exe
>>>
>>>
>>>
>>> I have also tried changing the Execute to "immediate" and sequencing the
>>> custom action after installfinalize.
>>>
>>>
>>>
>>> Every time I run I get a 1631 return from my custom actions.
>>>
>>>
>>>
>>> The command line works just fine when run from a cmd prompt. What am I
>>> missing here?
>>>
>>>
>>> ------------------------------------------------------------------------
>>> -
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>>> your
>>> opinions on IT & business topics through brief surveys-and earn cash
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
>>> V
>>> _______________________________________________
>>> WiX-users mailing list
>>> WiX-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>>
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>>> your
>>> opinions on IT & business topics through brief surveys-and earn cash
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>> _______________________________________________
>>> WiX-users mailing list
>>> WiX-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>>
>>>
>>
>>
>
>

--
View this message in context: 
http://www.nabble.com/custom-action-to-reg-NET-2.0-tf3373202.html#a9635469
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to