0

I want to restrict my setup, which I made using launch4j, to get installed only on a specific computer. To be specific, I want to get the MAC address of the computer and check if it is that specific computer and then allow it to install the setup(or run exe).

I searched online for it, but I couldn't find any solution

Lang: java
IDE: NetBeans
Executable made by using: Launch4j
setup installer Made by Inno Setup Compiler

Lin Du
  • 88,126
  • 95
  • 281
  • 483

1 Answers1

0

There is possibility that the computer would have no network card or have many of them therefore making MAC address-based recognition error prone.

Retrieving MAC addresses of network interfaces on computer

Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();

while (networkInterfaces.hasMoreElements()) {
    NetworkInterface networkInterface = networkInterfaces.nextElement();

    System.out.println(networkInterface.getName() + " " +
        networkInterface.getDisplayName());
}

The problem of many MAC addresses can be mitigated with hashing the MACs' concatenated string. But there still is an issue of no existing MAC address case.


Another possibility of unique identifying of computer is to hash some of it internal specifications, eg processor serial number, processor identifier, operating system, etc. For example by using cross-platform OSHI library. This solution is not dependant on existing network adapters on the machine.

Xarvalus
  • 2,873
  • 1
  • 19
  • 29