We are going to need a great amount of preinitialized apps, therefore we've been thinking about cloning them programmatically.
We found a method that looks perfect for our needs (https://help.qlik.com/en-US/sense-developer/3.2/apis/net%20sdk/html/M_Qlik_Engine_Hub_CopyApp.htm), but failed at making it work. It takes a third argument which is a list of the guid's of the elements to be copied into the new app. It's default behaviour when an empty list is provided, I quote, is that it "copies only the data and the objects necessary to open the app" - so no sheets get copied, though we want those too!
We tried doing few things, like using all the guids of objects inside the app, that results in an error n. 9003, engine id not found.
Here is a short code sample (yes, we already know that the app to be copied into must already exist, and is to be created before the cloneapp function is called):
IAppIdentifier srcAppId = _location.AppsWithNameOrDefault(srcAppName).First();
List<string> ids = _location.App(srcAppId).GetAllInfos().Select(info => info.Id).ToList();
IAppIdentifier newAppId = _location.CreateAppWithName(newAppName);
_location.Hub().CopyApp(newAppId.AppId, srcAppId.AppId, ids);
The resulting error is
Qlik.Engine.MethodInvocationException: 'Resource not found :Resource not found(Engine ID not found)'
I can post the logs too, if you think it's necessary. Please, any help is appreciated. Thanks