简体   繁体   中英

Inno Setup with a java application

I really want to use inno setup or another software like that to make a "professional" installer, where the application is distributed through a license key or serial, and I want to make sure the installer can only install just once on a given machine. This is to prevent people from copying files from the installation folder and pasting them into another computer. I have read a lot of topics on this, but it always goes to the same point, only 1 key for an installer which means it can be installed several times with the same key.

I had tried locking my app directly without the inno installer, by setting a check with the motherboard id, but it's not the way that I want and is not perfectly designed. This is because the software can have several valid keys, but when someone uses one, the key isn't valid anymore.

If you know no what computer it will run, at programming stage, you can easily restrict other computers by explicitly checking at the IP address, at the beginning of your code.

In case you don't know which computer it will be, but run it just on the first computer, you should save on an internal resource file, that it had already runned once. Writing to internal resource may be a little complicated.

In any case, restricting to one use, may also use the internal resource solution, but in case you don't require it (say, you know on which computer it will run) you can use preferences:

// in the beginnig of your main
if(Preferences.get("myapp.usedonce") != null)
    return;

// at the end of main
Preferences.put("myapp.usedonce", "yes");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM