WampServer 3.0 & UAC (User Account Control)?
Posted by: MadSpaniard (---.hsd1.ga.comcast.net)
Date: November 22, 2015 03:21PM

Hello - I've installed the new WampServer 3.0 provided by Otomatic on Windows 7 Professional.

It seems that the new WampServer 3.0 installation package may not be entirely compatible with User Account Control (UAC) in Windows 7. Is anyone else experiencing this?

Note: for all of the following scenarios, I am logged in as an administrator-level account that is NOT the explicit "Administrator" acount (i.e. I'm logged in under "myaccount" with is added to the Administrators group).

Specifically:

1. If I install WampServer 3.0 by double-clicking the installer with UAC enabled (set at the default setting), then WampServer icon will not turn green upon launching Wamp and will not run.

2. If I install WampServer 3.0 by double-clicking the installer with UAC disabled (set at "Never Notify" + reboot after disabling UAC), then WampServer icon will turn green and run properly.

3. However, the previous WampServer 2.5 installs and runs properly with UAC enabled (at default setting).

Some Additional Observations:

4. If I install Wampserver 3.0 with UAC enabled (set at default) AND execute the Wamp 3.0 installation package using "Run as Administrator", and then let the installer start Wamp upon completion, then it installs and runs properly.

5. If after #4 above I stop and then re-start Wamp 3.0 WHILE ALSO specifying "Run as Administrator", then it will turn green and run properly.

6. However, If after #4 above I stop and then re-start Wamp WITHOUT specifyng "Run as Administrator", then it will NOT turn green and will not run properly. In fact, it will then delete the php.ini located in the apache bin folder (thus causing Wamp 3.0 to not run properly afterwards, even if you "Run as Administrator", because the php.ini no longer exists).

In summary:

I'm finding that if UAC is enabled: then the new Wamp 3.0 only runs if you ALWAYS specify "Run as Administrator" BOTH during installation AND also when launching Wamp. The previous Wamp 2.5 did not require this, which makes me wonder if Wamp 3.0 is fully compatible with UAC.

Workaround: if I disable UAC, then Wamp 3.0 installs and runs properly.

Might anyone have any insights or thoughts on this? Thanks in advance.

Options: ReplyQuote
Re: WampServer 3.0 & UAC (User Account Control)?
Posted by: Otomatic (Moderator)
Date: November 22, 2015 04:25PM

Hi,

The shortcut created on the desktop is with option "run as administrator". It shows a shield.

A key is created during installation that tell system to run wampmanager.exe ASADMIN
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\wamp\\wampmanager.exe"="RUNASADMIN"

It is specify to :
- run the installer "as an administrator" **
- run Wampserver "as an administrator"

** The Inno Setup installer has the option:
PrivilegesRequired=admin
This directive affects whether elevated rights are requested (via a User Account Control dialog) when the installation is started.
When set to admin, Setup will always run with administrative privileges. If Setup was started by an unprivileged user, Windows will ask for the password to an account that has administrative privileges, and Setup will then run under that account.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 11/22/2015 04:33PM by Otomatic.

Options: ReplyQuote
Re: WampServer 3.0 & UAC (User Account Control)?
Posted by: MadSpaniard (---.hsd1.ga.comcast.net)
Date: November 22, 2015 05:33PM

Hello Otomatic - thank you so much for your reply.

I tried again on a clean installation of Win 7 Pro x64. I verified that the registry key you indicate is properly set after the Wamp 3.0 installer is run, so that is good.

I also verified that BOTH the shortcut to start wampserver in the Start Menu and on the Desktop have the Privilege Level set to "Run this program as an administrator" (i.e. if you right-click on the shortcut for Properties, then Compatibility tab).

HOWEVER: it seems those aren't having any effect: meaning the "run as administrator" setting on the shortcut icons (Properties->Compatbility) does not seem to have any effect UNTIL AFTER I RESET IT on the Start Menu and Desktop icons i.e. I go to Properties/Compatibility tab, then click on "change settings for all users", then uncheck the box and SAVE, then re-check the box and SAVE AGAIN.

Here's what I tried:

1. Install Wamp 3.0 by double-clicking (do not execute installer with "Run as Admnisistrator"winking smiley. DO NOT let installer start Wamp directly when installer completes.

2. Start Wamp from either Start Menu or Desktop Icon by double-clicking: wamp will not start (won't turn green).

3. Right-click on either Start Menu or Desktop icons, to to Properties - Compability tab. Click "change settings for all users", then uncheck "run as administrator" and Save, then re-check "run as administrator" and SAVE AGAIN.

4. Start Wamp from either Start Menu or Desktop Icon by double-clicking: now wamp will start and turn green.

I'm wondering if perhaps the Wamp 3.0 installer is doing something different with respect to UAC than the prior Wamp 2.5, since the Start Menu/Desktop Icons for Wamp 2.5 do not have "run as administrator" set, but the wampserver starts and turns green.

Thanks again, best regards.

Options: ReplyQuote
Re: WampServer 3.0 & UAC (User Account Control)?
Posted by: Otomatic (Moderator)
Date: November 22, 2015 05:46PM

Hi,

> HOWEVER: it seems those aren't having any effect: meaning the "run as administrator" setting
> icon the shortcut icons (Properties->Compatbility) does not seem to have any effect

There is another option for shortcuts to "run as administrator" :
- Properties
- Shortcut Tab
- Advanced button
- Check "Run as an administrator"
- Apply, OK, OK

> I'm wondering if perhaps the Wamp 3.0 installer is doing something different with respect to UAC
> than the prior Wamp 2.5, since the Start Menu/Desktop Icons for Wamp 2.5 do not have "run as administrator"
The installer script for Wampserver 2.5 was from a very old version of Inno Setup (I think for Wampserver 2.0).
As I write in the thread WAMPSERVER 3.0.0.
I have taken nothing from the original script; I wrote everything from scratch. And three weeks before leaving the installer Wampserver 3.0.0, I knew nothing about Inno Setup.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 11/22/2015 06:05PM by Otomatic.

Options: ReplyQuote
Re: WampServer 3.0 & UAC (User Account Control)?
Posted by: MadSpaniard (---.hsd1.ga.comcast.net)
Date: November 22, 2015 06:36PM

Hello Otomatic -

Yes, I'm aware of that (i.e. Properties / Shortcut Tab / Advanced / Run as Admin): If you check the box to Run as Admin, then it launches properly and turns green.

Note that this box is not checked by default after running the installer, so if you simply double-click on ethe shortcut either from the Start Menu or Desktop icons, then Wamp will not start and will not be green, and furthermore the php.ini file (in apache folder) gets deleted. So if you subsequently check the "Run as Admin" box, the damage has been done (i.e. php.ini deleted) and then wampserver will turn green, but there will be errors.

I still wonder if there may be something peculiar with how the installer itself interacts with UAC: it seems that one should not have to specifically check "Run as Admin" on the Start Menu / Desktop icons after installation in order to run wamp, if one is logged in under an administrator-level account.

The prior Wamp 2.5 Start Menu and Desktop icons by default did not have "Run as Admin" checked, so perhaps there's a way for the Wamp 3.0 installer to set it up in a similar fashion that is UAC-ready, without having to make adjustments post-installation to Start Menu / Desktop icons. I'm just wondering - I have no idea how to achieve that.

Thanks again, I greatly appreciated your help and efforts on Wamp 3.0. Cheers.

Options: ReplyQuote
Re: WampServer 3.0 & UAC (User Account Control)?
Posted by: Otomatic (Moderator)
Date: November 22, 2015 07:10PM

Hi,

> and furthermore the php.ini file (in apache folder) gets deleted.
It is not a file but a symbolic link to wamp/bin/php/php5.6.15/phpForApache.ini

It would be preferable that the installation puts a "real" file and not a symbolic link. Anyway, at the launch of Wampserver, through the "refresh" of wampmamaner.ini, the file or symbolic link is deleted and replaced with a symbolic link to the "good" file.

> I'm just wondering - I have no idea how to achieve that.
I thought ... I seek ...

One bright spot, I found how to launch Edge (Windows 10) from the command line. winking smiley

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: WampServer 3.0 & UAC (User Account Control)?
Posted by: Otomatic (Moderator)
Date: November 30, 2015 06:29PM

Hi,

I think I'll add wampmanager.exe.manifest file to declare that wampmanager.exe require administrator rights to be launched.
At the same time, and if possible with the manifest, I could limit to launch a 64-bit version of Wampmanager only if it is a 64 bit version of Windows ; and, perhaps, make sure the VC ++ packages are installed... we can dream!

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: WampServer 3.0 & UAC (User Account Control)?
Posted by: MadSpaniard (---.hsd1.ga.comcast.net)
Date: December 01, 2015 02:00AM

Hello Otomatic -

Yes, using Run as Administrator across the board seems to ensure it all works well. First I insall WampServer 3.0 by running the installer by right-clicking on it and "Run as Administrator", and then I simply edit the desktop and start menu shortcuts to have the "Run as Administrator" box checked.

If you decide to adjust the installer to automatically check for the required VC++ packages, perhaps it could display a notification indicating which ones are missing and ask for user confirmation before automatically installing them, in case the user would rather do it manually.

Thank you again for all of your great work on WampServer 3.0. It's excellent. Cheers.

Options: ReplyQuote
Re: WampServer 3.0 & UAC (User Account Control)?
Posted by: Otomatic (Moderator)
Date: December 01, 2015 06:41PM

Hi,

I do not know if the code below will be useful for you, but after much research and readings of documentation (And Microsoft documents are anything but easy to understand), I can generate shortcuts with the option "Run as administrator" checked directly with Inno Setup.

// in [code ] section of Inno Setup
//--- Modify shortcuts 'run as administrator'
procedure CurPageChanged(CurPageID: Integer);
var
   CD, GS: TFileStream;  
begin
   if CurPageID = wpFinished then
   try
      CD := TFileStream.Create(ExpandConstant('{commondesktop}\{#MyAppName}.lnk'), fmOpenReadWrite);
      CD.Seek($15,soFromBeginning);
      CD.WriteBuffer(Chr($20), 1);
      GS := TFileStream.Create(ExpandConstant('{group}\{#MyAppName}.lnk'), fmOpenReadWrite);
      GS.Seek($15,soFromBeginning);
      GS.WriteBuffer(Chr($20), 1);
   finally
      CD.Free;
      GS.Free;
   end;
end;

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.