HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Bypass User Access Control for HeroBlade, etc.  (Read 1808 times)

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Bypass User Access Control for HeroBlade, etc.
« on: May 03, 14, 03:28:34 PM »

If you are like me then you find it annoying needing to click "Yes" to the dialog Do you want to allow the following program to make changes on this computer? everytime I start up HeroBlade or the Repo Browser or the Player Client.  But, of course, I don't want to disable User Access Control altogether, and Windows does not allow exceptions to that Control.

So I researched a way to bypass that dialog on the internet and am sharing it here for anyone interested. It's a bit of a hack and sad that MS makes us jump through these hoops, but at least this works.

The gist of it is that one can set up a scheduled task to run HeroBlade using the highest permissions, bypassing the UAC, and create a shortcut to run that task.  But of course HeroBlade does not run properly when run directly from the executable, so running it directly from the task is out.  So here are the steps (this assumes you have Administrator privileges on your pc):

  • Create a batch file that will open the appropriate heal file.  To do that, just create a text file and change its extension to "bat".  You can still edit that file in any text editor such as Notepad.  Since I was going to be creating a few of these, I just put them in a folder in my C drive called "Admin Batches", starting with HeroBlade.bat.
  • In HeroBlade.bat I put one line:
    START C:\"Program Files (x86)"\HeroEngine\HEROBLADEHC022\HeroBladeHC022.heal
    You will need to substitute the location and name of your heroblade heal file.  Also note, I tried it with quotes around the whole path and it did not work; only when they were just around Program Files (x86).
  • Open the Windows Task Scheduler.  Easiest way is to click Run from the Start Menu (if it is enabled) and enter "taskschd.msc".  Otherwise you may right-click "My Computer", select Manage, then navigate to the "Task Scheduler Library".
  • Right-click where the tasks list is and select Create New Task.  In the dialog that opens, name the task HeroBlade and be sure the "Run with highest privileges" box is checked on the General tab.  Then on the Actions tab click New...  Make the action Start a Program and for program/script browse to the HeroBlade.bat file.  Click OK to complete the action, then OK to complete the task.  Now running that task will launch HeroBlade with no confirmation needed.  You can run it directly from the Task Scheduler to test it.
  • To make it more convenient, right-click an empty space on your desktop and select New-->Shortcut.  Enter
    schtasks.exe /run /tn "HeroBlade"
    for the location of the item, then name the shortcut HeroBlade.
  • Right-click the shortcut and open its Properties.  On the Shortcut tab change the icon and browse to the HeroBlade executable to get its icon.  Click OK on the properties window.
  • Drag that shortcut to the taskbar to pin it there.

Voila!  You now have a pinned shortcut to open HeroBlade without needing confirmation.  You can repeat the process for the repo browser and generic player client heal files.  This, combined with the auto-login that was added to HeroBlade in the last engine update, makes getting in a breeze.
« Last Edit: Nov 27, 16, 12:00:44 PM by FI-ScottZ »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.