Old 27th November 2003, 14:01   #1
Haggy
Junior Member
 
Join Date: Nov 2003
Posts: 3
Send a message via ICQ to Haggy
Question .NET Assemblys RegAsm

Hi!

I'm using the NSIS for the first time.


I want to make an Installer which installs severals .NET Assemblys. I've found here how to make it that i can use the gacutil.

But how can I implement that the Nsis register my class by RegASM?

Thank you all for your help

Haggy
Haggy is offline   Reply With Quote
Old 1st December 2003, 13:02   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Is RegASM an executable too? If so, just execute it using ExecWait, Exec or the nsExec plug-in.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 2nd December 2003, 07:38   #3
Haggy
Junior Member
 
Join Date: Nov 2003
Posts: 3
Send a message via ICQ to Haggy
Hi
Yes it is, but I don't know the path of it.

Because it is in the .NET Directory and there in the Directory of the Current version e.g. 1.1.387 and i don' know how to get the current installed version auf .NET Framework, the user has :-/

I don't know too if the regasm and the gacutil were only in the SDK or in the standard framework included.

thank you

Haggy
Haggy is offline   Reply With Quote
Old 2nd December 2003, 10:54   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Well, if it's not big, I think you can save yourself the hassle and just include it in the installer. If it is big, you might be able to get the directory of the latest .NET framework using a varient of the following function:

http://nsis.sourceforge.net/archive/....php?pageid=24

Please post your result on the Archive, if you can get that function to give you the directory of the latest version.

BTW, I think gacutil and regasm come only with the SDK, but MSDN will probably know better.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 3rd January 2004, 10:00   #5
phallguy
Junior Member
 
Join Date: Jan 2004
Posts: 1
Simple Reg Script solution

Since COM registration is a registry only based operation you can use the regasm tool on your local machine to generate the registry script that can be used to install your component. You can then use the standard registry manipulation tools in NSIS to update the registry. Simply add the /regfileutput parameter to the command line of the regasm tool to create the script.
phallguy is offline   Reply With Quote
Old 3rd January 2004, 11:13   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
And to convert from .reg to .nsi you can use this tool:

http://nsis.sourceforge.net/archive/...php?pageid=296

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 19th December 2005, 09:27   #7
mattwilkinson
Junior Member
 
Join Date: Dec 2004
Location: Stoke on Trent UK
Posts: 18
Can I just make the point that if you are using regasm to register your assembly, you should also unregister it in your uninstall section. Therefore if you are using a .reg file, you need to create one for registering and one for unregistering your assembly and package both of them.

Because of this problem I have decided to register my assemblies on the machine using regasm (this gives a double check that the .NET framework is install btw because if regasm is no-where to be found - it needs to be installed)

I have a problem however with the following lines:

ClearErrors

;find the location of RegAsm
ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft .NET Framework 2.0" "InstallLocation"

;execute regasm passing the path to my assembly
Exec '"$R1RegAsm" "${sInst}${sApp}.exe" /silent /tlb:"$SYSDIR\${sApp}.tlb" /codebase'
IfErrors 0 +2
MessageBox MB_OK "Error Registering ${sInst}${sApp}"

The assembly registers ok but even though I am specifying the /silent option, I still get a empty dos style box appearing at this point.
This will be a particular problem for me because I have around fifty of the these assemblies to register!

Has anyone come across this problem?
mattwilkinson is offline   Reply With Quote
Old 20th December 2005, 17:10   #8
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You can use the nsExec plug-in which is bundled with NSIS, or the ExecDos plug-in.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump