# Bytes getModuleManager().installModule(String, Bytes)

**URL:** <https://forum.inductiveautomation.com/t/bytes-getmodulemanager-installmodule-string-bytes/7181>\
**Category:** Module Development\
**Created:** [September 3, 2013, 5:30pm UTC](https://forum.inductiveautomation.com/t/bytes-getmodulemanager-installmodule-string-bytes/7181 "2013-09-03T17:30:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fejowayne8701](https://avatars.discourse-cdn.com/v4/letter/f/e8c25b/32.png) [@fejowayne8701](https://forum.inductiveautomation.com/u/fejowayne8701)\
**Post date:** [September 3, 2013, 5:30pm UTC](https://forum.inductiveautomation.com/t/bytes-getmodulemanager-installmodule-string-bytes/7181/1 "2013-09-03T17:30:36Z")

</div>

I’d like to know what exactly is needed for the bytes parameter to install a module programmtically. Is this array the number of bytes the module is limited to to run or the number of bytes allocated to it for startup.

public void setup(GatewayContext context) {  
try {  
this.m\_context = context;  
} catch (Exception e) {  
m\_logger.fatal(“Error setting up module.”, e);  
}  
}

modulesCreatedProviders = m\_context.getModuleManager().getModules();  
// m\_context.getModuleManager().installModule(this.toString(), );  
for (Object providerObj : modulesCreatedProviders) {  
m\_context.getModuleManager().restartModule(providerObj.toString());  
m\_context.getModuleManager().uninstallModule(providerObj.toString());  
byte startup[] = new byte[500];  
m\_context.getModuleManager().installModule(providerObj.toString(), startup);

---

<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:** [September 3, 2013, 5:36pm UTC](https://forum.inductiveautomation.com/t/bytes-getmodulemanager-installmodule-string-bytes/7181/2 "2013-09-03T17:36:04Z")

</div>

It’s neither… it’s the bytes representing the modl file and all its contents.

Why are you doing this?

---

<div class="post-metadata">

**Author:** ![fejowayne8701](https://avatars.discourse-cdn.com/v4/letter/f/e8c25b/32.png) [@fejowayne8701](https://forum.inductiveautomation.com/u/fejowayne8701)\
**Post date:** [September 3, 2013, 7:37pm UTC](https://forum.inductiveautomation.com/t/bytes-getmodulemanager-installmodule-string-bytes/7181/3 "2013-09-03T19:37:17Z")

</div>

Our tag provider is not a conventional tag provider so I have to attempt to either one unload the module persisting all of it’s meta data in an object and then reload it it or get the module id and try to reload the tag provider some how.  
The simple tag provider method was not use and there is no easy way to obtain the settings meta without recreating the tag provider object in which is impossible without all of the gateway meta.
