wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.14k stars 1.21k forks source link

Unable to Run App When Adding UAC Manifest to Go Executable #2625

Open KiddoV opened 1 year ago

KiddoV commented 1 year ago

Description

I am unable to run the app through wails dev when setting UAC for Windows manifest file.

Got this err:

FATAL: Unable to start application: fork/exec C:\MultiTech-Projects\GO Source Code Files\Web-Applications\Wails\xdot-controller-v2\build\bin\xdot-controller-v2-dev.exe: The requested operation requires elevation.

To Reproduce

wails.exe.manifest

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <assemblyIdentity type="win32" name="com.wails.{{.Name}}" version="{{.Info.ProductVersion}}.0" processorArchitecture="*"/>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
        </dependentAssembly>
    </dependency>
    <asmv3:application>
        <asmv3:windowsSettings>
            <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware> <!-- fallback for Windows 7 and 8 -->
            <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness> <!-- falls back to per-monitor if per-monitor v2 is not supported -->
        </asmv3:windowsSettings>
    </asmv3:application>

    //Adding UAC here!
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
        <requestedPrivileges>
            <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
        </requestedPrivileges>
        </security>
    </trustInfo>
</assembly>

Expected behaviour

App run normally

Screenshots

No response

Attempted Fixes

No response

System Details

Wails CLI v2.4.1

Scanning system - Please wait (this may take a long time)...Done.

# System

OS           | Windows 10 Enterprise LTSC 2021
Version      | 2009 (Build: 19044)
ID           | 21H2
Go Version   | go1.19
Platform     | windows
Architecture | amd64

# Wails

Version | v2.4.1

# Dependencies

Dependency | Package Name | Status    | Version      
WebView2   | N/A          | Installed | 112.0.1722.58
npm        | N/A          | Installed | 8.15.0
*upx       | N/A          | Installed | upx 3.96
*nsis      | N/A          | Available | 
* - Optional Dependency

# Diagnosis

Your system is ready for Wails development!

Additional context

No response

xD0135 commented 1 year ago

Does this work when you wails build your app and run the executable?

leaanthony commented 1 year ago

We may need to have Dev versions of the manifest for Dev, like we do info.plist. should be a case of updating the cli to check if <name>.dev.exe.manifestexists and if it does, use that. You comfortable making that change?

Relevant ticket: https://github.com/wailsapp/wails/issues/1943

saucer-man commented 7 months ago

Is there currently a solution to this problem, or are there any plans to solve it?