CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Posts
    199

    Security exceptions writing to event log -porting app from XP to Vista

    I'm moving an app from XP to Vista... should work without changes, right? Uh uh. My app writes to the Windows Application event log.. now under Vista I get security exceptions.

    I have read that I can turn UAC off, but I don't want to force users to do that.

    So, here's my question - if I create my own Windows event log (instead of using "Application") will I still run into this problem? Or does it only come up if using one of Windows' own logs?

    thanks. Using .Net 3.5SP1

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Security exceptions writing to event log -porting app from XP to Vista

    Might be able to call an API, or else, you can have them install POWERSHELL, and you can write a script. PS uses the Net Framework.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Security exceptions writing to event log -porting app from XP to Vista

    Quote Originally Posted by purpleflash View Post
    I'm moving an app from XP to Vista... should work without changes, right?
    Oh no, not at all. If your program does something that requires administrative privileges you will probably be in for trouble. Even if an administrator launches a process, it is not run as an administrator unless explicitly told to do so by the user. So, if you can't help the fact that you need elevated privileges, create a manifest file with the a requested execution level. Users will have to enter credentials when your program is started.

    http://community.bartdesmet.net/blog...ng-mt.exe.aspx

  4. #4
    Join Date
    Sep 2006
    Posts
    199

    Re: Security exceptions writing to event log -porting app from XP to Vista

    That's stupid... isn't the event log there for events to be captured? I see no point in restricting access to writing to the event log.

    I'm using ClickOnce to deploy... so I think that means I have to get admin rights in the application's code. Is there a way to do this?

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured