inverse-inc / packetfence-windows-agent

Windows application for WiFi and wired autoconfiguration with PacketFence.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PacketFence Windows Agent in Golang

Windows app for the auto-configuration of wired and wireless networks with PacketFence

Getting Started

Follow the following instructions to get your PacketFence agent running.

Set up

Compiled with Go Programming Language amd64 version 1.17 To set up your Go environment, see Getting Started.

Then set up your environment variables :

  • Search "env" in Windows and click Enter
  • Click on 'Environment Variables'
  • In System Variables, select Path and click 'Edit'
  • Click on 'New', and add C:\\Go\\src, C:\\Go\\bin, and the directory of the PacketFence Windows agent (usually C:\Users\[UserName]\Go\bin)

===========

Files used : parse.go, rsrc.syso

===========

Create the manifest packetfence-windows-agent.exe.manifest

<?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="packetfence-windows-agent.exe"
		type="win32"
	/>
	<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 xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
			<dpiAware>true</dpiAware>
		</asmv3:windowsSettings>
	</asmv3:application>
	<description>PacketFence Provisioner</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
        <requestedPrivileges>
            <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
        </requestedPrivileges>
    </security>
</trustInfo>
</assembly>

Then compile the manifest using the [rsrc tool] (https://github.com/akavel/rsrc) :

go install github.com/akavel/rsrc@latest
rsrc -manifest packetfence-windows-agent.exe.manifest -o rsrc.syso
Build app

In the directory containing parse.go, run :

go build

NOTE: To have the cmd window, you need to comment the hideConsole() line in parse.go, and then build normally

Cross compiling for 32-bit

First, set the following environment variable

GOARCH=386

Then, compile the application like you would normally do.

Run app

To run the application, type :

packetfence-windows-agent.exe

About

Windows application for WiFi and wired autoconfiguration with PacketFence.


Languages

Language:Go 100.0%