I usually include the manifest as a resource in the file but it can be external so that is an option. It would require restarting the application.
But it's not ideal because it will prompt for administrators password or "Continue" if you are an administrator when the apps starts. This will be a problem because the app is usually running 24/7 and needs to restart after a power failure. A permanent service may be the best option if it's possible. Cheers, Ross. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rohit Gupta Sent: Saturday, 12 May 2007 2:10 To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] SmallPort under Vista Since the .manifest file is xml, you could modify it when the user configures the app to use the port. Ross Levis wrote: > I'm not sure how I'm going to resolve this Vista issue. > > I'm using a free Delphi component called SmallPort > (http://www.torry.net/quicksearchd.php?String=smallport) for direct access > to the LPT port under all versions of Windows from 95 to XP. > > It is an optional feature in my app to switch pins on the LPT port high & > low which triggers external switch units. > > Unfortunately it is not working under Vista unless I force administrator > privileges for my app. It returns "Access is Denied". > > For 95/98/ME it uses a supplied VXD driver. For NT/2000/XP it uses a > supplied .sys file which is loaded as a service. It's using OpenSCManager, > CreateService (with the .sys file) and StartService, etc. > > I know how to raise the privileges for the entire app using a manifest, but > only about 5% of my users will be using this facility so mandatory elevation > is not a solution. > > I've never used services before so this is a bit beyond me. I have a couple > of ideas in mind but I don't know if either will work. > > 1. Install this .sys file permanently as a service which starts when Windows > starts. It's a tiny thing so it's hardly going to use any resources. I > have no idea how to do this. > > Then modify the component to only open the service rather than create it. > I'm still not sure if administrator access is required. It could well be so > this may not work. ??? > > 2. Move the service code into a separate executable which has an > administrator manifest and return the service handle back to the component > in my app to use as required. I would use shared memory for this > communication. > > The question is, would the handle be valid in another app running in a > different memory space? I think it would be the address of the service in > memory which would be static for all apps, so this may work. > > Option 2 is also not ideal as it would prompt to "Continue", or ask for an > administrators password every time the app starts if the user is using this > facility. > > I know some of you on this list create and use services so I'm interested to > hear your suggestions. > > Thanks, > Ross. > > _______________________________________________ > NZ Borland Developers Group - Delphi mailing list > Post: [email protected] > Admin: http://delphi.org.nz/mailman/listinfo/delphi > Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe > > > _______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe _______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
