Jump to content

SciTE edit as admin by default


Recommended Posts

I previously ran SciTE and Autoit from a Windows XP machine and therefore didn't have any UAC or privileges issues to deal with. Now I'm running Win7 64 bit and noticed that when opening a .au3 file I don't get any prompt choice to run as admin. It simply opens the file I requested. When I hit F5 or click on "Go" to run the application SciTE is unable to hook into the app and get Console output when run like this.

I can, however, go through the trouble of opening SciTE independently as administrator before opening the source code .au3 files and when I hit f5 or "Go" like this I am again able to get ConsoleWrite output as well as get runtime errors.

My question: Is it possible to modify the SciTE editor so that it prompts to run as administrator when attempting to open a .au3 file rather than right clicking on SciTE and manually selecting to run as administrator and then opening the .au3 file? I'm trying to achieve a shortcut and save time while removing one more annoyance that is UAC Win7 powered.

Many thanks!

Link to comment
Share on other sites

I found a method that works, but it isn't the method I was looking for. I was looking for the SciTE equivalent to AutoIt's #RequireAdmin. If someone has the answer to this still I would appreciate it.

Meanwhile, what I discovered is allow the OS to request privilege elevation at runtime. Right clicked on SciTE.exe in the program files dir -> Properties -> Compatibility Tab -> check "run......as an admin..."

This same idea can be applied to a shortcut under a different submenu, but I did it to the .exe since I would rather open the .au3 file directly to get the prompt and be done with the whole process quickly!

Link to comment
Share on other sites

That's probably the best way of having SciTE run under admin credentials. I don't believe there's any command in the SciTE configs that would tell it to ask for Admin privileges before running.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Too bad. It works this way, however, regardless if SciTE is running the UAC elevation prompt presents its annoying self for every instance a new .au3 is opened and then gets applied as a new tab on the running SciTE editor. Regardless, it could always be worse I suppose. :D At least I have my sight and my hard drive hasn't failed this year! .)

Link to comment
Share on other sites

  • Developers

I currently have no option to test this, but maybe creating your own manifest by creating file scite.exe.manifest in the scite directory containing the below will force this?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
        <requestedPrivileges>
            <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
        </requestedPrivileges>
    </security>
</trustInfo>
</assembly>

Just a thought :D

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 4 weeks later...
  • Developers

mmm... that clearly didn't work, but it does work when you replace the current Manifest inside of SciTE.exe with the below info:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
                 manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="*"
    name="Scintilla.SciTE.SciTE"
    type="win32"
/>
<description>SciTE</description>
<asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
        <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
</asmv3:application>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
<!-- Identify the application security requirements. -->
<!-- level can be "asInvoker", "highestAvailable", or "requireAdministrator" -->
   <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
      <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="requireAdministrator"
          uiAccess="false"/>
      </requestedPrivileges>
    </security>
   </trustInfo>
</assembly>

You can do this with reshacker or CFF Explorer, which I use mostly.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...