276
Views
3
Comments
Programmatically extract source code from xif
Question

OutSystems extensions are saved as binary XIF files. Opening a XIF with Integration Studio produces a folder with the extension's source code.

I would like to obtain the source code from a XIF file programmatically, maybe through another C# extension.

Does anybody know if this is possible?

I am already using OutDoc to obtain an XML that represents an OML file, but I have not found anything similar that would work for XIF files.

2019-06-15 21-39-22
Afonso Carvalho
 
MVP

Hello Lucas,

I know OAP files - the extension used for files containing OutSystems applications can be opened by file archivers like 7-Zip or WinRAR. However, XIF files don't follow the same logic, and I believe the logic behind them is internal and undocumented.

Integration Studio does immediately unpack them as soon as they're opened - it's not even necessary to insert environment credentials. However, unlike Service Studio, there don't seem to be any command line arguments available, so there doesn't appear to be a way to invoke Integration Studio programatically to do the XIF unpacking for you.

Automation with something like AutoHotKey or UIPath could be an idea. Would you mind sharing more about your use case? Maybe someone else can weigh in with more details.

UserImage.jpg
Lucas Castelo

Hi Afonso, thanks for your message.

I have indeed already tried a file archiver with XIF files, but that doesn't work. It seems like these files are simply some proprietary binary format.

My goal is to keep a git repository with the XML encoding of OML's (and ideally the source code of the extensions) and automatically create a new commit whenever a new module version is saved. 

Automation like that is quite clunky, so I don't think it would work nicely. If there's no better alternative we would sadly have no choice other than continuing to download the two different versions of an extension locally and comparing the code that way.

2017-06-21 13-04-28
Mikko Nieminen

If your goal is to have a repository of your extension source code, why bother with all those intermediate steps of packing and unpacking the extension in the first place? Commit to version control before compiling your extension. If you only want to check if extension is changed, some checksums and/or OutSystems internal version numbers can be used for that.

If you want to see what is inside an extension someone else developed, ymmv. By my understanding, Xif is a binary format which contains some compiled dll(s) and additionally the source .NET code as a some kind of resource. While it might be surprising, adding source code to extension is completely optional, only binaries are needed. Just try opening EspaceMetamodel extension from OutDoc in Integration Studio for example.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.