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 (usuallyC:\Users\[UserName]\Go\bin
)
===========
Files used : parse.go, rsrc.syso
===========
packetfence-windows-agent.exe.manifest
Create the 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