acameron
asked on
C# installer to install software as different user
Hello,
I would like to use C# or C/C++ to write a quick little installer to install a program I have (but did not write) as an administrator. The program has to be installed as an administrator but I do not want to give out the admin password so I need an installer to install the program as admin even though the installer is getting called by say bob.
I would like to use C# or C/C++ to write a quick little installer to install a program I have (but did not write) as an administrator. The program has to be installed as an administrator but I do not want to give out the admin password so I need an installer to install the program as admin even though the installer is getting called by say bob.
Will Windows let you do that? I wouldn't think so. Users are not made administrators for a reason. I'd be surprised if the software can override the user settings of the operating system.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am getting a whole bunch of undeclared identifiers, what headers do I need to include to test this?
You should already have those functions protyped. A single #include "windows.h" is sufficient.
ASKER
Nevermind, I found it. Let me test this out and I will be back.
Oh yes, I thought you wanted the ability to do this on any machine where you would not know the admin password.
ASKER
Ok, does not appear to be entering the if to assign user and then execute...
ASKER
Found the problem I overlooked the Win2k issue. I am running Win2k pro. any ideas?
As previously stated:
The user must have been granted the 'Act as part of the operating system' user right.
Sorry, but no other solution to it.
The user must have been granted the 'Act as part of the operating system' user right.
Sorry, but no other solution to it.
ASKER
I've got it, I can make a system call to runas. Any idea how I can make c++ wait for the password prompt, then enter the password?