Hey Peter, As to the first question you probably need a custom install step to add the event source at the time of installation. That install will still require those elevated privileges but at least the app won't need to run elevated for every day use.
As to CrankPad. Thanks! The version of Crank that you got is technically the most up to date (I made no changes to the core functionality before adding the UI over the top). As for the CrankPad UI itself, I will be making it available soon. Life (and work) has just been a bit crazy since last Thursday and the code is really an architectural spike (i.e. Messy, buggy and barely demo-worthy). As for becoming a product....I have some ideas but the core stuff you saw in that 10 minute demo would be the free part of the "fremium" model :) I'll stick a post up on http://codermike.com when it goes up. On Fri, Dec 9, 2011 at 3:46 PM, Peter Maddin <[email protected]>wrote: > Thanks Michael**** > > ** ** > > Running the console app in elevated mode worked ok.**** > > ** ** > > What I need to know is**** > > **· **Can I install the application for average joe blow (no > elevated privileges possible) so that it works. If not what do I need to do > to get this to work.**** > > **· **Alternatively, have I found something that works in XP but > breaks when using Vista or better .**** > > ** ** > > For something completely different.**** > > I loved your CrankPad presentation (as did everyone else apparently).**** > > Is this available or is it something that you might be developing into a > commercial app, so its not available?**** > > I got a copy of crank from codeplex but this is the command line app (and > pretty old too).**** > > ** ** > > *Regards Peter Maddin* > *Applications Development Officer* > *Path**West Laboratory Medicine WA* > *Phone : +618 6396 4285 (Monday, Wednesday,Friday)* > > *Phone : +618 9346 4372 (Tuesday, Thursday)** > Mobile: 0423 540 825* > *E-Mail : [email protected]; [email protected]* > *The contents of this e-mail transmission outside of the WAGHS network > are intended solely for the named recipient's), may be confidential, and > may be privileged or otherwise protected from disclosure in the public > interest. The use, reproduction, disclosure or distribution of the contents > of this e-mail transmission by any person other than the named recipient(s) > is prohibited. If you are not a named recipient please notify the sender > immediately**.***** > > **** > > ** ** > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *Michael Minutillo > *Sent:* Friday, 9 December 2011 3:35 PM > > *To:* ozDotNet > *Subject:* Re: Event Log**** > > ** ** > > Wild-@$$ Guess: When the app is trying to see if the event source already > exists it is trying to enumerate over the set of existing sources but there > some it cannot read/see. There is no good response (true or false) so the > call throws. Even if you are a local admin you might need to run in > Elevated Privileges to perfrom that action. Try right clicking on your > console app and selecting "Run as Administrator" and see if that works.*** > * > > **** > > > Michael M. Minutillo > Indiscriminate Information Sponge > http://codermike.com > > **** > > On Fri, Dec 9, 2011 at 3:20 PM, Peter Maddin <[email protected]> > wrote:**** > > I wrote a simple console application to test writing to the application > event log.**** > > **** > > However I get an exception when I run it (Windows 7)**** > > **** > > What am I doing wrong?**** > > I am a local administrator and I only want to write to the existing > application event log.**** > > If I can’t get this to work, how will the average Joe User?**** > > **** > > using System;**** > > using System.Collections.Generic;**** > > using System.Linq;**** > > using System.Text;**** > > using System.Threading;**** > > using System.Diagnostics;**** > > namespace ConsoleEventLog**** > > {**** > > class Program**** > > {**** > > const string ConsoleEvents = "ConsoleEvents";**** > > static void Main(string[] args)**** > > {**** > > bool hadEnough = false;**** > > **** > > // Exception here**** > > > // {"The source was not found, but some or all event logs could not be > searched. Inaccessible logs: Security."} > **** > > if (!EventLog.SourceExists(ConsoleEvents))**** > > EventLog.CreateEventSource(ConsoleEvents, "Application");* > *** > > while (!hadEnough)**** > > {**** > > Console.WriteLine("1 : Error event");**** > > Console.WriteLine("2 : Warning event");**** > > Console.WriteLine("3 : Info event");**** > > Console.WriteLine("4 : Exit");**** > > Console.WriteLine("");**** > > var x = Console.ReadKey();**** > > Console.WriteLine("");**** > > switch (x.KeyChar)**** > > {**** > > case '1':**** > > Console.WriteLine("1 pressed");**** > > LogError();**** > > break;**** > > case '2':**** > > Console.WriteLine("2 pressed");**** > > LogWarning();**** > > break;**** > > case '3':**** > > Console.WriteLine("3 pressed");**** > > LogInfo();**** > > break;**** > > case '4':**** > > Console.WriteLine("4 pressed");**** > > hadEnough = true;**** > > break;**** > > default:**** > > Console.WriteLine("Don't be a cretin");**** > > break;**** > > }**** > > Thread.Sleep(1000);**** > > Console.Clear();**** > > }**** > > }**** > > public static void LogError()**** > > {**** > > EventLog.WriteEntry(ConsoleEvents, "this is an error event", > EventLogEntryType.Error, 1);**** > > }**** > > public static void LogWarning()**** > > {**** > > EventLog.WriteEntry(ConsoleEvents, "this is an warning event" > , EventLogEntryType.Warning, 2);**** > > }**** > > public static void LogInfo()**** > > {**** > > EventLog.WriteEntry(ConsoleEvents, > "this is an informational event", EventLogEntryType.Information, 3);**** > > }**** > > }**** > > }**** > > **** > > *Regards Peter Maddin* > *Applications Development Officer* > *Path**West Laboratory Medicine WA* > *Phone : +618 6396 4285 (Monday, Wednesday,Friday)***** > > *Phone : +618 9346 4372 (Tuesday, Thursday) > Mobile: 0423 540 825* > *E-Mail : [email protected]; [email protected]* > *The contents of this e-mail transmission outside of the WAGHS network > are intended solely for the named recipient's), may be confidential, and > may be privileged or otherwise protected from disclosure in the public > interest. The use, reproduction, disclosure or distribution of the contents > of this e-mail transmission by any person other than the named recipient(s) > is prohibited. If you are not a named recipient please notify the sender > immediately**.***** > > **** > > **** > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *Joseph Clark**** > > > *Sent:* Friday, 9 December 2011 2:02 PM > *To:* ozDotNet > *Subject:* Re: Event Log**** > > **** > > As far I can remember from the last time I looked at this stuff... writing > to the event log as a Joe user is fine - the problem is that creating the > "event source" for the log entries required administrative escalation. > > **** > > On Fri, Dec 9, 2011 at 4:24 PM, Peter Maddin <[email protected]> > wrote:**** > > I am looking at maintaining an old vs2005 vb.net application.**** > > **** > > This has been running on XP Pro workstations.**** > > From trawling through the code, I have found that it uses the event log > for recording errors.**** > > **** > > I have open and converted the solution into VS2010.**** > > I noticed that errors are being written to the application event log.**** > > **** > > I suspect that on windows 7 (probably Vista as well) that a normal user > may run into problems when trying to write to the application event log.** > ** > > **** > > Is this likely to be a problem if the application is installed on windows > 7 and run by a user with minimal rights and permissions?**** > > **** > > *Regards Peter Maddin* > *Applications Development Officer* > *Path**West Laboratory Medicine WA* > *Phone : +618 6396 4285 (Monday, Wednesday,Friday)***** > > *Phone : +618 9346 4372 (Tuesday, Thursday) > Mobile: 0423 540 825* > *E-Mail : [email protected]; [email protected]* > *The contents of this e-mail transmission outside of the WAGHS network > are intended solely for the named recipient's), may be confidential, and > may be privileged or otherwise protected from disclosure in the public > interest. The use, reproduction, disclosure or distribution of the contents > of this e-mail transmission by any person other than the named recipient(s) > is prohibited. If you are not a named recipient please notify the sender > immediately**.***** > > **** > > **** > > **** > > ** ** >
