dcsimg
Results 1 to 7 of 7

Thread: [RESOLVED] RegAsm and Windows 7

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2006
    Location
    Vienna, Austria
    Posts
    31

    Resolved [RESOLVED] RegAsm and Windows 7

    Hello folks!

    I just developed one COM interop component in VB.NET 2010. Everything is fine, on my development machine everything works properly.
    I would like to distribute this dll with all dependencies on other machines as well.
    I just did a test on the brand new installation of Windows 7 x64 and x86 Enterprise version.
    The following command line failed to execute:

    Code:
    "c:\myapp\regasm.exe" "C:\myapp\CameraController.dll" /tlb:"C:\myapp\CameraController.tlb" /codebase
    It has raised the following error:

    Code:
    Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1
    Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.
    
    RegAsm : error RA0000 : An error occurred while writing the registration
    information to the registry. Administrator permissions are needed to use the
    selected options. Use an administrator command prompt to complete these
    tasks."
    This command line works perfectly on Windows XP. I must mention that I want to register this component from a bat file and I have no clue what I'm doing wrong. I even tried to use "runas", but it's asking me for the password whole the time however system doesn't have any password set.

    Has anybody any idea how to register one COM interop dll on Windows 7 systems from the batch file?
    Any help, input, hint is highly appreciated.

    Thank you in advance!

    Bela

  2. #2
    Member
    Join Date
    Jun 2010
    Posts
    43

    Re: RegAsm and Windows 7

    Not sure, but have you checked if UAC is enabled ?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2006
    Location
    Vienna, Austria
    Posts
    31

    Re: RegAsm and Windows 7

    UAC was initially enabled but I turned off. I getting the same message from regasm in command prompt window. When I run command prompt as administrator then works! But how to execute regasm as administrator from one .bat file? I cannot expect from simple users to do these steps. Maybe "runas" is a solution, but it asks me for a password when I want to start cmd as administrator however system doesn't have any password. In XP everything is fine, but Win7 is very frustrating sometimes. :-/
    Any workaround?

  4. #4
    Hyperactive Member
    Join Date
    Jul 2011
    Posts
    278

    Re: RegAsm and Windows 7

    Are the users local administrators?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2006
    Location
    Vienna, Austria
    Posts
    31

    Re: RegAsm and Windows 7

    There is only one user: Developer (without any password) and he is the system administrator.

  6. #6
    Hyperactive Member
    Join Date
    Jul 2011
    Posts
    278

    Re: RegAsm and Windows 7

    This seems to be what you're after.

    Don't have time to test it myself, but it's just a suggestion.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    May 2006
    Location
    Vienna, Austria
    Posts
    31

    Re: RegAsm and Windows 7

    Hi folks!
    Seems to be I solved the problem. I would like to share my experience.
    Here it is what I did to using "regasm.exe" register a COM interop dll written in VB.NET 2010:

    1) First of all, I had to turn off UAC. I did it from the script of course, because I cannot expect from end-user to start "msconfig" and play with the settings.

    I simply modified the values in the registry:
    In "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System" there are two important settings for this case: "EnableLUA" and "ConsentPromptBehaviorAdmin". They have value different then zero by default. These values I set to 0.

    2) Restart the system (I forgot to do that, this was the reason why "regasm" didn't work)

    3) Start installation again from registry's "Run Once"

    4) Install the interop dll with all dependencies

    5) Register dll and export tlb using regasm.exe:

    "c:\myapp\regasm.exe" "C:\myapp\CameraController.dll" /tlb:"C:\myapp\CameraController.tlb" /codebase

    6) Set values back to "EnableLUA" and "ConsentPromptBehaviorAdmin" (that OPTIONAL, but I did)

    7) Restart the system once again (only in case of 6))

    That's all. Everything works fine!

    Thank you for helping me and giving suggestions!

    Have a nice weekend!
    Bela

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width