This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How to check for admin privileges in InstallScript
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
07:39 AM
How to check for admin privileges in InstallScript
My app needs admin privileges to install because it has to install a font. In InstallShield 12, the following worked fine (this is a short version of a helpful message that tells them exactly what to do):
if (Is(USER_INADMINGROUP,"") = FALSE) then
MessageBox( "You need admin rights to install this app.", SEVERE );
With InstallShield 2010, that works fine the FIRST time a non-admin user tries to install. After that, however, the non-admin user automatically gets this uninformative message: "The installed version of the application could not be determined. The setup will now terminate."
Apparently, InstallShield checks for the version before my script can do anything at all. That would be fine if it also checked for admin rights and gave one of the nice "you need admin rights" messages that are in the 0x0409.ini file, or if I could change this unfriendly, useless message, but neither seems possible. I don't want to go back to InstallShield 12 because I need to set some file permissions. The only way I've found to get around this is to allow for multiple install instances, but I really can't do that--I have a lot of users who wouldn't be able to handle that extra complication.
HELP!
Thanks,
Ann
if (Is(USER_INADMINGROUP,"") = FALSE) then
MessageBox( "You need admin rights to install this app.", SEVERE );
With InstallShield 2010, that works fine the FIRST time a non-admin user tries to install. After that, however, the non-admin user automatically gets this uninformative message: "The installed version of the application could not be determined. The setup will now terminate."
Apparently, InstallShield checks for the version before my script can do anything at all. That would be fine if it also checked for admin rights and gave one of the nice "you need admin rights" messages that are in the 0x0409.ini file, or if I could change this unfriendly, useless message, but neither seems possible. I don't want to go back to InstallShield 12 because I need to set some file permissions. The only way I've found to get around this is to allow for multiple install instances, but I really can't do that--I have a lot of users who wouldn't be able to handle that extra complication.
HELP!
Thanks,
Ann
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
10:20 AM
Typically on modern version of Windows (Vista and higher), you should handle this by setting the launcher to run as administrator. This is then indicated to the user before launching your install because of the shield icon on it.
Are you concerned that you will have a lot of users who are not administrators trying to install your application on machines which already have it installed? We find that typically users who are not administrators are in environments where their software is installed for them.
Are you concerned that you will have a lot of users who are not administrators trying to install your application on machines which already have it installed? We find that typically users who are not administrators are in environments where their software is installed for them.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
11:14 AM
I changed the setup.exe properties in the Release to Administrator too, and the non-admin user still gets the same unhelpful message. I thought maybe I wasn't changing the property correctly, so I changed the size of the init dialog as well. The init dialog size changed, but I still didn't get any "must run as admin" message.
We have some of the world's most unsophisticated users. It's educational software used primarily by beginning college students. For a good number of them, this is the first software they've ever tried to install on their own, and more of them than you might expect have a hand-me-down computer that still has the child's user settings that they had when it was their parent's computer--equals without admin privileges. So it may be more of a problem for us than for most companies.
So you're telling me that the function that dealt with this problem well in InstallShield 12 purposely no longer works in InstallShield 2010?
We have some of the world's most unsophisticated users. It's educational software used primarily by beginning college students. For a good number of them, this is the first software they've ever tried to install on their own, and more of them than you might expect have a hand-me-down computer that still has the child's user settings that they had when it was their parent's computer--equals without admin privileges. So it may be more of a problem for us than for most companies.
So you're telling me that the function that dealt with this problem well in InstallShield 12 purposely no longer works in InstallShield 2010?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
12:31 PM
Just realized I wasn't specific enough in my last post. On Vista and higher, it DOES indeed work to change the setup.exe setting. My problem is on XP, which is what a lot of the kids are using when they inherit a parent's older computer. I could switch back to InstallShield 12 and create an installer just for XP users, but a lot of these kids aren't entirely clear on what system they're using, so I fear that we'd still have a lot of tech support incidents because of this problem because they wouldn't be able to figure out which installer they were supposed to use. We're a very small company with only one tech support person for about 25,000 users, so it's really necessary to keep everything as simple as possible with our population, sad to say.
Ann
Ann
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
12:57 PM
I've got good news. You just need to do your check earlier, in OnSetUpdateMode (under category Initialization), or otherwise change the code in OnSetUpdateMode to avoid this undesired behavior. The message you are seeing comes from the string in there with identifier IDS_IFX_ERROR_UPDATE_NO_INSTALLED_VERSION, so put your code before that.
(As a side note, I'm a little surprised that a user with such limited knowledge is expected to know what to do when they see the message you quoted; perhaps you use a more informative message in your actual product. :))
(As a side note, I'm a little surprised that a user with such limited knowledge is expected to know what to do when they see the message you quoted; perhaps you use a more informative message in your actual product. :))
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
04:05 PM
You're a life-saver! This works! Exactly what I needed, and in time to put it on the CD master too. Many, many, many thanks.
As for the message--no that's not the real message. After all, these kids have already picked the wrong choice in the official-looking message that gives them the choice of installing as a non-admin user or as administrator but tells them which choice is more likely to work, so they've proven they're not the brightest in their class. I'm always tempted to tell them they should just call their parents to get the admin password, since that's likely what they really need to do, but so far, I've resisted that temptation!
Anyway, THANKS! I'm a very happy camper now.
Ann
As for the message--no that's not the real message. After all, these kids have already picked the wrong choice in the official-looking message that gives them the choice of installing as a non-admin user or as administrator but tells them which choice is more likely to work, so they've proven they're not the brightest in their class. I'm always tempted to tell them they should just call their parents to get the admin password, since that's likely what they really need to do, but so far, I've resisted that temptation!
Anyway, THANKS! I'm a very happy camper now.
Ann
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 23, 2010
08:00 AM
Where is this located? OnSetUpdateMode ?
Do you mean she should continue to runt he IS script at the top, and then sequnce at a certain point? I don't understand what OnSetUpdateMode is or where it is to set. Please advise.
Do you mean she should continue to runt he IS script at the top, and then sequnce at a certain point? I don't understand what OnSetUpdateMode is or where it is to set. Please advise.
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)