-
Dec 13th, 2016, 07:23 AM
#1
Thread Starter
Registered User
[RESOLVED] RunAsAdmin just Once?
Hi there,
Steve MacMahon's reg code runs beautifully if the app is run as admin.
If not, the reg keys cannot be opened (at least in W10 1607). Thing is, the app is set up to run as invoked, but it would be nice if it could be run as admin just once initially to set the keys.
Don't think that is possible somehow but any ideas / suggestions / code welcome.
Thanks!
-
Dec 13th, 2016, 07:48 AM
#2
Re: RunAsAdmin just Once?
Just create an installer and be done with it.
-
Dec 15th, 2016, 09:04 AM
#3
Re: RunAsAdmin just Once?
You could also create and execute a shortcut to run your app elevated, then execute that.
A smooth implementation might be a little tricky... check access, no, write and execute shortcut with command indicating so, if thats the case write keys, exit this instance or kill other instance (if former must wait for execution).
dilettante's suggest is of course better, but I share your antipathy towards installers, having never come across an install creator that allows a large variety of customizations but isn't ridiculously hard to use, leaving rolling my own or just doing without as the better options.
-
Dec 15th, 2016, 11:14 AM
#4
Re: RunAsAdmin just Once?
Last edited by dz32; Apr 26th, 2019 at 11:34 AM.
-
Dec 15th, 2016, 03:13 PM
#5
Re: RunAsAdmin just Once?
Oh wow brain fart on that one. Do dz32's method instead unless you just have as much fun as I do playing with shell interfaces. You still need the kind of implementation I was talking about for your Sub Main, but can just use a shellexecuteex api call instead of a shortcut.
-
Dec 16th, 2016, 11:04 AM
#6
Thread Starter
Registered User
Re: RunAsAdmin just Once?
Thanks, that's the kind of thing sought for.
Although nothing beats a good installer. there's a few around- Wix, for one appeals- has anyone any experience of InstallForge, Smart Install, the Install Creator (no price on the commercial version), the Visual installer, for instance?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|