Skip to content

mahozad/compose-exe-manifest

Repository files navigation

A Gradle plugin for Compose Multiplatform projects to embed a manifest in the app exe file.

Note

The embedding only works for create*Distributable and run*Distributable tasks.
The plugin currently does NOT work for packaging tasks (like packageExe).
For run*Distributable tasks, start your terminal or IDE as administrator.

Usage

import ir.mahozad.manifest.ManifestMode

plugins {
    // ...
    id("ir.mahozad.compose-exe-manifest") version "1.0.0"
}

composeExeManifest {
    enabled = true
    manifestMode = ManifestMode.EMBED
    manifestFile = file("app.manifest") // Same directory as the build file
}

Example app.manifest to make exe run as administrator

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
  <assemblyIdentity version="1.0.0.0"
     processorArchitecture="X86"
     name="MyApp"
     type="win32"/> 
  <description>Description of my application</description>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="requireAdministrator"
          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>