# Setting LicenseState for a custom module

**URL:** <https://forum.inductiveautomation.com/t/setting-licensestate-for-a-custom-module/36155>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [June 29, 2020, 1:26pm UTC](https://forum.inductiveautomation.com/t/setting-licensestate-for-a-custom-module/36155 "2020-06-29T13:26:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![betti.francesco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/betti.francesco/32/6309_2.png) [@betti.francesco](https://forum.inductiveautomation.com/u/betti.francesco)\
**Post date:** [June 29, 2020, 1:26pm UTC](https://forum.inductiveautomation.com/t/setting-licensestate-for-a-custom-module/36155/1 "2020-06-29T13:26:53Z")

</div>

Hello, I made a custom module and it’s working great, but when I install on the gateway the the License shown is trial: I tried to figure out how to set the kind of license inside the code, but I can’t really understand how it’s done. Looking at the classes and the documentation, the objects that are retrievable from the custom ModuleHook class can only get informations regarding the state of the license, but I cannot find a way to set the state of the license. In this page:

[http://files.inductiveautomation.com/sdk/javadoc/ignition79/794-beta1/com/inductiveautomation/ignition/common/licensing/package-summary.html](http://files.inductiveautomation.com/sdk/javadoc/ignition79/794-beta1/com/inductiveautomation/ignition/common/licensing/package-summary.html)

are listed some of the basic classes representing basic kinds of licenses: there’s a FreeLicenseState that I guess is what I need, but how to use it?  
For example, I tried to override the startup method in my ModuleHook class:

```auto
    @Override
    public void startup(@NotNull LicenseState activationState) {
        super.startup(new FreeLicenseState());
    }

```

but it’s now working. Anyone knows how to do it?  
Thanks in advance,  
Francesco

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 29, 2020, 1:31pm UTC](https://forum.inductiveautomation.com/t/setting-licensestate-for-a-custom-module/36155/2 "2020-06-29T13:31:06Z")

</div>

You don’t set the license state.

Your module can either indicate it’s free or otherwise it receives the license state from the platform. A non-free module is only licensed if it’s actually present on the license.

---

<div class="post-metadata">

**Author:** ![betti.francesco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/betti.francesco/32/6309_2.png) [@betti.francesco](https://forum.inductiveautomation.com/u/betti.francesco)\
**Post date:** [June 29, 2020, 1:58pm UTC](https://forum.inductiveautomation.com/t/setting-licensestate-for-a-custom-module/36155/3 "2020-06-29T13:58:59Z")

</div>

Hello thanks for replying. So how can I set the module as a free module? Basically I just need to hide the Trial state that is listed in the modules status page on the gateway.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 29, 2020, 2:04pm UTC](https://forum.inductiveautomation.com/t/setting-licensestate-for-a-custom-module/36155/4 "2020-06-29T14:04:17Z")

</div>

Override `isFreeModule()` in `GatewayModuleHook` and return `true`.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 29, 2020, 3:20pm UTC](https://forum.inductiveautomation.com/t/setting-licensestate-for-a-custom-module/36155/5 "2020-06-29T15:20:47Z")

</div>

Also, if you want it to work on Maker, you’ll need to override `isMakerEditionCompatible` in the same place (as long as you’re building against an SDK target of 8.0.14 or higher).

---

<div class="post-metadata">

**Author:** ![betti.francesco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/betti.francesco/32/6309_2.png) [@betti.francesco](https://forum.inductiveautomation.com/u/betti.francesco)\
**Post date:** [June 29, 2020, 8:16pm UTC](https://forum.inductiveautomation.com/t/setting-licensestate-for-a-custom-module/36155/6 "2020-06-29T20:16:06Z")

</div>

Many thanks, it’s simpler than I thought 🙂
