mojomatt

Different @osversion macro results depending on execution level

6 posts in this topic

I'm running AutoIT version 3.3.12

When I compile the below scripts and run them on a Windows 2012R2 server I get differing results depending on if it's compiled using "Default" executionlevel or "asInvoker"

 

The below compiled script correctly outputs "WIN_2012R2" (using "Default" executionlevel)...

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Fileversion=4.3.2.1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

MsgBox(48,"",@osversion)
Exit

 

The below compiled script incorrectly outputs "WIN_2012" (using "asInvoker" executionlevel)...

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Fileversion=4.3.2.1
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

MsgBox(48,"",@osversion)
Exit

 

Is this expected behavior or is this a bug?

 

Thanks

 

Share this post


Link to post
Share on other sites



Default manifest:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 	<dependency>
 		<dependentAssembly>
 			<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"/>
 		</dependentAssembly>
 	</dependency>
 	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
 		<security>
 			<requestedPrivileges>
 				<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
 			</requestedPrivileges>
 		</security>
 	</trustInfo>
	<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
 		<application>
 			<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
			<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
			<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
			<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
			<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
		</application>
 	</compatibility>
</assembly>

 

 After AutoIt3Wrapper modified manifest:

#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker


 

<?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" >

    <!-- Identify the application security requirements. -->
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel
                    level="asInvoker"
                    uiAccess="false"
                />
            </requestedPrivileges>
        </security>
    </trustInfo>

    <!-- Identify the application dependencies. -->
    <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0"
                language="*"
                processorArchitecture="*"
                publicKeyToken="6595b64144ccf1df"
            />
        </dependentAssembly>
    </dependency>

    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <application>
            <!--The ID below indicates application support for Windows Vista -->
            <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
            <!--The ID below indicates application support for Windows 7 -->
            <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
            <!--The ID below indicates application support for Windows 8 -->
            <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
            <!--The ID below indicates application support for Windows 8.1 -->
            <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
            <!--The ID below indicates application support for Windows 10 -->
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
        </application>
    </compatibility>
</assembly>

 

I do not know the difference, I do not have Win_2012R2 to test!


“The world won’t care about your self-esteem. The world will expect you to accomplish something Before you feel good about yourself.”

Share this post


Link to post
Share on other sites

I just updated to 3.3.14.2 and see the same behavior.  pic.thumb.png.0aa501da68bf946404915fec27

 

Here's the console output of the compilation...

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /ShowGui /in "C:\Users\xxxxxx\Desktop\Test\test.au3"
+>15:38:35 Starting AutoIt3Wrapper v.2.1.4.0 SciTE v.3.3.7.0 ;  Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0409  Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
-> No changes made..
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3
+>15:38:45 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\aut2exe\aut2exe.exe  /in "C:\Users\xxxxxx\Desktop\Test\test.au3" /out "C:\Users\xxxxxx\AppData\Local\AutoIt v3\Aut2exe\~AU3ipffiyj.exe" /nopack /comp 2
+>15:38:48 Aut2exe.exe ended.C:\Users\xxxxxx\AppData\Local\AutoIt v3\Aut2exe\~AU3ipffiyj.exe. rc:0
>15:38:48 Performing the Program Resource Update steps:
...>Updating Program Version information.
...>Setting Program ExecutionLevel Manifest information to asInvoker
...>Updating Program Manifest information.
>15:38:48 Program Resource updating finished successfully.
+>15:38:48 Created program:C:\Users\xxxxxx\Desktop\Test\test.exe
>Exit code: 0    Time: 14.975

Share this post


Link to post
Share on other sites
5 minutes ago, mojomatt said:

I just updated to 3.3.14.2

I wasn't talking about AutoIt3, but about SciTE4AutoIt3 which contains autoit3wrapper!

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Gotcha, yes that did the trick.  @OSVersion now correctly shows WIN_2012R2.

I should follow my own advice - When in doubt - always update to the latest version :)

Thanks Jos

Share this post


Link to post
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