VMware Horizon Community
tpc1337
Contributor
Contributor
Jump to solution

Unable to open edited DEM zip files

Hi,

 

From an automation perspective, I am trying to place config files in de AppData directory for certain applications. Now I have everything working (automation wise), but I discovered settings are not applied since the .zip file cannot be read. It causes a fatal error when looking at the logs for the specific user. From https://communities.vmware.com/t5/Dynamic-Environment-Manager/Error-while-importing-UEM-settings-Fat... I saw UEMdev making a comment that the management console has trouble reading edited .zip files. I was and am still wondering if there is a workaround for this. I tried looking at differences between a config file generated by the management console and a config file generated by our automation (Ansible). There seems to be something underwater that is prohibiting the .zip files to be read by DEM / management console. I am wondering what this is and if there is a workaround, since this would make automating the end user experience a lot easier.

 

Kind Regards,

Tim

0 Kudos
1 Solution

Accepted Solutions
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi @tpc1337,

As promised, a quick write-up of FlexEngine's COM interface for creating "DEM approved" zip files. It's not an official API that we guarantee to maintain in the future (although it's very improbable that it will change), and there's no official support (happy to provide no-SLA-best-effort support in this forum, though.)

With that out of the way, here goes.

You can instantiate the COM object through the ImmidioFlexProfiles.Engine ProgID.
In VBScript that would be something like Set flexEngine = CreateObject("ImmidioFlexProfiles.Engine"),
and in PowerShell $FlexEngine = New-Object -ComObject ImmidioFlexProfiles.Engine .

There are two methods defined:

  • Zip(source folder, destination archive, log file, compress yes/no)
  • UnZip(destination folder, source archive, log file)

Note that all paths (i.e. folder, archive, and log file) must be fully-qualified absolute paths. The compression argument is a boolean, taking $true/$false or True/False for PowerShell and VBScript, respectively.

Hope that helps!

View solution in original post

9 Replies
sjesse
Leadership
Leadership
Jump to solution

Why do you need to edit the zip files? Honestly why not just put ansible on the parent image and have it push the files you need? Its something I've wanted to try for while but I haven't gotten to it yet. That or can you place that fileserver, and use a UEM login script to import them.  Unless they adjust how DEM unzips and zips the archives you have to work around modifying them. 

0 Kudos
tpc1337
Contributor
Contributor
Jump to solution

Unfortunately I cannot put our client machines (VDIs) in the Ansible inventory because of licensing reasons. So the option I am stuck with is targeting the DEM fileserver with Ansible. I am using a template XML and ZIP file for the "Files and Folders" section in management console. I created this with the management console. When our automation pipeline is nearly at an end, the end users playbooks / roles are kicked off. Ansible copies the template XML file, injects user specific conditions (which works well, since it shows up in the management console after editing), after that the template .zip file is extracted, the .ini file that resides in the extracted archive is replaced with a template (also filling some user specific variables) and then the archive will be compressed to a .zip file.
Although the setting does show up in the management console, when a user logs in falling under the condition (eg Active Directory group), the settings are not applied, and a FATAL error is logged in the user's archive log file, indicating the .zip file created by Ansible cannot be read.

0 Kudos
sjesse
Leadership
Leadership
Jump to solution

What I'm saying it trying though is like you've already mentioned you can't edit the files. I'm assuming its similar to an iso,  you can unzip an iso with most archive tools now, but I'm not aware of any that can zip them back up like an iso and have it work correctly. I would focus your automation on other ways of getting the files in there. @DEMdev may have an updated opinion on this, but I've never seen any hint of any plans to allow modification of the archives.

0 Kudos
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi @tpc1337,

Thanks for starting a new thread for this, and thank you, @sjesse, for that nudge 🙂

It's not so much that the Management Console "has trouble reading edited .zip files" – it actively enforces our "own" format, so we don't have to deal with any potentially exotic zip flavor that could be created by other tools.

There is a COM interface to create "DEM approved" zip files. It's not officially supported, but it's what the Management Console uses for its own zip/unzip actions, so it works perfectly fine. It's just that VMware support won't be able to support it, and we don't consider it a public API (in the sense that we don't guarantee that we will never change it, although it has been the same since forever...)

If that sounds interesting to you, I can whip up a brief description early next week.

0 Kudos
tpc1337
Contributor
Contributor
Jump to solution

Hey thanks for the quick reply, thats completely understandable then. I am quite interested in using a COM interface to create those approved zipfiles. Also wondering how that would work, but yeah that would be cool if you could give me some detail about that!

0 Kudos
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi @tpc1337,

Sounds good, I'll get back to you next week.

DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi @tpc1337,

As promised, a quick write-up of FlexEngine's COM interface for creating "DEM approved" zip files. It's not an official API that we guarantee to maintain in the future (although it's very improbable that it will change), and there's no official support (happy to provide no-SLA-best-effort support in this forum, though.)

With that out of the way, here goes.

You can instantiate the COM object through the ImmidioFlexProfiles.Engine ProgID.
In VBScript that would be something like Set flexEngine = CreateObject("ImmidioFlexProfiles.Engine"),
and in PowerShell $FlexEngine = New-Object -ComObject ImmidioFlexProfiles.Engine .

There are two methods defined:

  • Zip(source folder, destination archive, log file, compress yes/no)
  • UnZip(destination folder, source archive, log file)

Note that all paths (i.e. folder, archive, and log file) must be fully-qualified absolute paths. The compression argument is a boolean, taking $true/$false or True/False for PowerShell and VBScript, respectively.

Hope that helps!

tpc1337
Contributor
Contributor
Jump to solution

Sorry for the late reply, I tested this and it works, thanks a lot!

Tags (1)
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi @tpc1337,

Happy to hear it works!

0 Kudos