stefan_riediger
Posts: 33
Joined: Fri Feb 18, 2022 4:07 pm

Display changes of previous version of an project

Hi Advanced Installer team,

is there a kind of diff of two projects in Advanced Installer

Usually in a version control system you can view the differences of the source code between two commits an see the lines which changed.

Is there something similar in Advanced Installer?
Comparing the aip files is not so really helpful.

best regards,
Stefan
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Display changes of previous version of an project

Hello Stefan and welcome to our forums,

At its core, the .AIP file is an XML document. With that in mind, you can do a diff between two projects by using a software such as Notepad++.

However, I am not quite sure how much that would help, as you would have to be familiar with the XML structure of the project, which is not the easiest thing.

Of course, this would be the closest to this:
Usually in a version control system you can view the differences of the source code between two commits an see the lines which changed.
Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stefan_riediger
Posts: 33
Joined: Fri Feb 18, 2022 4:07 pm

Re: Display changes of previous version of an project

Hi Catalin,

thank you for your quick reply (Very impressive).
Yes, for most changes diffing the XML is OK.

The trouble I have are especially the custom PowerShell (signed) inline script actions which are encrypted.

best regards,
Stefan
vpodans
Posts: 35
Joined: Tue Dec 27, 2011 3:03 pm

Re: Display changes of previous version of an project

disclaimer: I'm not an AI support, just random user of AI

Custom PS scripts aren't encrypted, they are encoded and you can easily recover the script using PowerShell. Copy encoded string from XML tag value to clipboard, then in PowerShell console insert copied base64 string:

Code: Select all

$base64 = @"
<paste clipboard text here. Must be on a new line
"@
$bytes = [convert]::frombase64string($base64)
$script = [text.encoding]::utf8.getstring($bytes)
given this if you really care about scripts and you know the custom action name, then you can enhance the script to this function, which dumps any PS custom action script from *.aip file. The script is freely available in my GitHub gist: https://gist.github.com/Crypt32/571711d ... 4e3edf8948

the usage is:

Code: Select all

Dump-AIScript -Path path\aiproject.aip "ActionName"
Keep in mind that action names are case-sensitive.


(signed)
it doesn't matter since scripts are not signed in AI project. They are always unsigned. Signing is performed during MSI build and signed script is embedded into MSI, but you will never see signed script in AI project file.
®
stefan_riediger
Posts: 33
Joined: Fri Feb 18, 2022 4:07 pm

Re: Display changes of previous version of an project

Hi vpodans,

thank you very much for the explanation and the script. The script works. It is a bit complicated for that what I wanted to achieve, but I will use the script to view the past changes of our aip project.

For the future, trying out your explanation fortunately leads me to the idea switching all the inline PowerShell scripts to Attached Script files. Ok, I have to modify the parameters to reading AI_GetMsiProperty.
At first glance the msi installer seemed to work identically (hopefully).

It would have several advantages,
1. I can use the diff/merge tools from the version control system,
2. I can use Visual Studio Code for editing, where I can use the whole screen instead of a fraction, get all static code analysis and the Intellisense.
The AI_ command have to be stubbed in some way.

Thank you for your help

best regards,
Stefan
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Display changes of previous version of an project

Hello guys,

@vpodans,
Custom PS scripts aren't encrypted, they are encoded and you can easily recover the script using PowerShell. Copy encoded string from XML tag value to clipboard, then in PowerShell console insert copied base64 string
You are indeed right about this. And thank you for providing the script, it is really useful.

@Stefan,

I am glad to hear the script worked as expected.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”