Folk,
I need to bypass UAC, through my Installer. Please note I am using InnoSetup/NSIS/Advanced Installer. I have tried all settings like SILENT / VERYSILENT but nothing has worked.
Help me out :)
Regards
Subh
You cannot bypass UAC, the user is in control, that is the whole point of UAC! If you want to do machine wide changes that require Administrator privileges there is no way around it.
The only way to avoid it is to do per-user installs into [local]appdata & HKCU (Like Chrome etc). To avoid legacy setup detection you should use PrivilegesRequired/RequestExecutionLevel and only ask for lower/user privileges...
Thanks guys :)
I guess I fave found one solution of it, like If I do the following before Installing my EXE for temporary then on post Installation I revert it. then, I hope my purpose get solved.
[Registry]
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; ValueType: dword; ValueName: "ConsentPromptBehaviorAdmin"; ValueData: "0x00000000"
If anybody like to discuss on this ,
Here I am at skype : subh.anand
Go to Settings, Recovery, Advanced Restart. Press Trobleshoot, More Options, and Command Prompt. Then type in ren Utilman.exe Utilman1.exe ren cmd.exe Utilman.exe. Then go to the login screen, click the dotted power button and you have an admin command prompt!
Related
I'm using Inno setup for make a installation to my program.
And I would like to know, how to make the program to be installed in the user desktop by default?
I figured out, I need to use DefaultDirName=.
I need to know, what to write there for install to be on user desktop be default.
Any help?
Use {userdesktop} constant:
[Setup]
DefaultDirName={userdesktop}
You may also consider setting PrivilegesRequired to lowest, as you probably do not need the installer to run with Administrator privileges.
[Setup]
PrivilegesRequired=lowest
I've got a task to sort out a problem with our product installer and eventually came to a dead end with no ideas.
The installation process goes like:
Install files
Configure some services in [Run] section
Run our custom product configurator
If step 3 is successful (configurator returned good exit code) then start those services
else rollback installation
So the issue was something Shroedinger's - on SOME machines there were unexpected reboot after cancelling install in configurator, without any questions. Of course that annoyed users.
I couldn't figure out the criteria by which the machine decided to reboot, but I stumbled onto this thing:
In [Run] section
Filename: "stub.exe"; Flags: runhidden skipifdoesntexist; BeforeInstall: ConfigureService
Then in [Code], ConfigureService calls for InstallationAbort proc if configurator returned bad exit code.
Next, in InstallationAbort:
Exec(ExpandConstant('{uninstallexe}'), '/VERYSILENT /noinstancecheck', '', SW_HIDE,
ewWaitUntilTerminated, ErrorCode);
So the author calls for uninstaller WHILE IN THE INSTALLER.
Using logs I determined, that installation program doesn't end after uninstaller completes work! It's moving to the next step (installation finished)! After that I can see in log
Restart needed? Yes
Note: system never reboots if configurator is not cancelled, i.e installation finishes the right way.
So what I tried:
Adding /NORESTART to uninstaller Exec call. Doesn't help. I think that's because it's installer, who decides to make a restart.
Adding WizardForm.CancelButton.OnClick(WizardForm.CancelButton); and some other calls to exit setup after call to uninstaller. Doesn't help.
Overriding NeedRestart function to return false in case of cancellation
As I tried to understand, author calls uninstaller because of need to delete installed services (i.e. call them in UninstallRun with special parameters)
So, my main question: Is that a normal practice to call uninstaller from code called from [Run] section, to undo changes made in [Run]?
Is that a normal practice to call uninstaller from code called from [Run] section, to undo changes made in [Run]?
In general, it's not a common practice. One should not abort installation in Run section. Inno Setup is not designed to handle that.
But if you need to, there's no other way. The code you have is most probably based on this:
How to force Inno Setup setup to fail when Run command fails?
But that does not imply that the installer should require reboot. There's some conflict between the installer and uninstaller.
I want to install/create my own event log at install time using Inno Setup.
After a little bit of searching I found the key that needs to be created for nt source ...
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\[Source]
And it has an EventMessageFile value to log the messages themselves, (I think).
But I want the event source to be created during setup, (and run elevated if need be).
How can this be done?
And if the correct way is indeed to use the registry, what EventMessageFile must I use?
NB: When the app is running it is not elevated so it cannot happen at run time.
Yes, indeed, you create a key like
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\MyLog
And set value EventMessageFile to point to a DLL file that contain description strings for your events.
[Registry]
Root: HKLM; \
Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\MyLog"; \
ValueType: string; ValueName: "EventMessageFile"; ValueData: "{app}\MyLog.dll"
See Message Files article.
I hope someone can help. I have a small MS access database which I've converted into a .accde file and have managed to get Inno Setup to create a setup file which generally works.
When I install it on a Windows 7 machine and double click on the desktop shortcut that was installed it just works. However, if I install it on a Windows 8 machine and double click the desktop shortcut it works but it can't attach to the backend database. When I set the desktop shortcut advanced properties to run as administrator, it then works perfectly.
Just two quesitons if someone who know either Access or Inno or both.
Is it possible to get Inno to create a shortcut with the Run as Administrator set?
Is there soething with Access runtime that I'm not seeing or getting correct.
Any help would be very much appreciated.
Thanks
Dave
Old entry but maybe still worth a try:
the directory is readonly when you create it so writing is forbidden (should be the same for Win 7 but maybe you changed the security settings and Inno setup used the existing folder)
try the following: add the app directory with special permissions:
[Dirs]
Name: "{app}"; Permissions: everyone-full
If that works change the settings to something more secure like "AuthenticatedUsers-Full" or something similar
you should NOT need to run access with admin rights! But just to answer your question:
How to set 'Run as administrator' on a file using Inno Setup
I am trying to construct a silent install using Inno Setup. I am using the /SILENT and /VERYSILENT command parameters, and everything works fine, except for the UAC window popping up at the start.
How do I get around this issue?
I have found a few posts loosely mentioning about using SignTool, but other sources have said that this will simply change the UAC box blue with the publisher parameter filled.
Can anyone help here? The scenario is an installer which will be distributed over the internet to update existing software on a machine silently without any user interaction.
To run a setup elevated without the UAC prompt, you need to run it from something that is already elevated. It would defeat the entire point of UAC if programs could elevate without the user controlling access.
Signing the executable does just show the publisher.
The basic idea is to first install a service that runs under the Local System account, and this service will launch your update installers so that updates can bypass UAC, and don't force the end user to run as admin. If you don't want to develop one on your own, there are 3rd party solutions like this:
http://www.autoupdateplus.com/
When your users first install your application, an "updater service" gets installed, and all subsequent updates can be silent.
(We used to use AutoUpdate+, but later decided to roll our own which just downloads the full installer file of our appliation and runs it silently. This wasn't possible with AutoUpdate+, we had to create update packages with the changed files, which turned out to be too much hassle, with too much room for error.)
I have found one solution of it, like If I do the following before Installing my EXE for temporary then on post Installation I revert it. then, I hope my purpose get solved.
[Registry] Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; ValueType: dword; ValueName: "ConsentPromptBehaviorAdmin"; ValueData: "0x00000000"
You can install it as User Software. Then you have no problems with UAC because it is no system wide software. ProgramData must be stored in User Folders and Registery Settings must be done under CurrentUser.
Not sure if you like to do that.
But anyway. You do not have to take care of UAC. Companies will have a deployment server with elevated rights so silent deployment will not force there a UAC message.
The UAC message is the normal behavier