How to compare changes in two REGISTRY.DAT files the easy way:

When we change registry information in an existing APPV package we usually do so manually in the Sequencer, Ave or TMEdit then save the new version.
Afterwards we try to document that changed registry information and often forget some crucial information, making resequencing of the application later on harder than it should be.

During the development of an internal APPV workflow application we have created around Tweakappv, TMEdit and AVE, we also wanted to document what has been done in each applications REGISTRY.DAT after the APPV file is saved in a new version automatically.

The new and the old Registry.DAT file could be extracted automatically by 7zip command line version with this command: 7-Zip>7z.exe x "filaname.appv" "registry.dat" –y (just ignore archive errors, the registryfile will work non the less=)

But understanding the DAT files is not very easy.

By coincidence I found a tool a clever guy have made in C# and published for free called “Registry Comparator (GUI)”. It can be downloaded from that site once you registered an account there.

We are going to modify the source code so it will just pipe out the changes directly to our documentation log file with a commandline J

 

Here is his own words:

Introduction

In order to see how some software manipulate the Windows Registry, I needed a tool that could take two hive files, load them, and then compare them to show the differences between the two. I did find some code on the net that would compare files but not two registry hives in a nice graphical way. So I thought of coding one myself in C#. (Registry Hives are binary files, I don't mean here the .reg text based files made by regedit.exe.)

 

Background

Windows stores the Registry in binary files. The format of this Registry hive is not publicly available. The way data is stored in the Registry is simple. It begins with a Registry header of size 4096 bytes. It then starts off with Logical Data blocks - aka Cells. Based on the type of Logical Data blocks, it will have a list of pointers (called offsets = file offset from 4096th byte). These pointers point to another logical cell which has more information or data in them. Broadly speaking, there are two types of cells:

 

·         Node Key Cell

·         Value Key Cell

Node keys - as the name suggests - are nodes of a tree. It's like the directory in the Windows file system. A directory can have in it more directories and files. This node cell has four important pieces of information.

 

·         Number of Subkeys in this Node (or Key)

·         Pointer to a Cell that stores the address of these Subkeys.

·         Number of Value Key Cells in this node.

·         Pointer to a Cell that stores addresses of Value Keys.

A value key cell stores data. Value keys behave like files which have different types of formats and information. Values keys are broadly categorized into having text based information or binary information.

 

HIVE starts off with the ROOT node at (4096+32) address. Information is read by reading this first Node Key type cell. The subkey node information provides us link to the sub keys present in this node. We have to iterate through all the nodes to read the entire Registry hive. We also read the Value Keys as we iterate deeper into levels.

I have got some very good information (and coding help too) from these articles:

 

http://www.codeproject.com/Articles/24415/How-to-read-dump-compare-registry-hives

http://www.sentinelchicken.com/data/TheWindowsNTRegistryFileFormat.pdf

We then read these node information into a WinForms TreeNode and then plot them in a TreeView.

 

Once we have two hives loaded in two separate TreeViews, we then compare them using a simple iteration method. We assign color to TreeNodes based on the search status: Green is an unchanged reg key type, red is a key that was deleted (or not present) in the second file, blue is a key that was added into the second file (not present in the first), and pink means a Value Key that was changed in its data.

 

Hope this information will help you as much as it did for us.

How to Sequence Ibm Spss 26 (and 25):

Normally Ibm Spss have been  considered an easy application to sequence in the past.

But after we Sequenced version 26 on 1809 I had a rundown with the following error message when I lunched the application on the client:
App-V Subsystem 'Virtual Filesystem' could not be initialized. {error: 0x74300E0A-0x20006}

 

Googling this got me down a rabbit hole of a lot of old App-V treads, but nothing could help me.

The solution was actually pretty easy, throw away the 1809 sequencer and use the old 1709 sequencer.

How to Sequence:

The following cmd file will install your program. Just change LSHOST to your license server, and do the same to COMPANYNAME.

Regsvr could be removed, it was a thing from the past, but it won’t do anything.

echo Installing (1/3): Ibm Spss 26.x64

msiexec.exe /i "%~dp0IBM SPSS Statistics 26.msi" LICENSETYPE="Network" LSHOST="license.server.com" INSTALLPYTHON="1" COMPANYNAME="Your Company" DISABLEADVTSHORTCUTS=1 /qr /norestart /L*v c:\temp\spss26.log

echo Return Code: %ERRORLEVEL%

echo Installing (2/3): Regsvr of spsswin.dll:

regsvr32.exe /s "%CommmonProgramFiles%\IBM\SPSS\COM\spsswin.dll"

echo Return Code: %ERRORLEVEL%

echo Installing (3/3): Delete run once keys from 64 bit HKLM hive

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /f /reg:64

echo Return Code: %ERRORLEVEL%

 

 

 

Documentation for App-V-Sequenced application: Ibm Spss

Documention created: 06.09.2019 11:04

 

 

Installation

••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

 

Sequenced on Windows Version:10.0.17763.0 system with App-V Sequencer version: 10.0.16299.15

Sequenced created:06.09.2019 08:46:29

 

••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Appvnavn:Ibm Spss

Version:0.0.0.1

PackageID=5ea38113-1b4b-4ff9-b6d6-77a997a300a8

VersionID=852d4686-932d-4a83-9cc0-1a36f4dea2f3

••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

 

-----------------------------------------------------

Prerequirements before Sequencing:

-----------------------------------------------------

Sequenced on 1709 Sequencer machine. 1809 sequencer makes package crash on launch on our 1809 image with this error:

App-V Subsystem 'Virtual Filesystem' could not be initialized. {error: 0x74300E0A-0x20006}.

Install all package Vcreds into sequencer machine, could be found in vcred folder under application when installed. Also install them on your production computers.

-----------------------------------------------------

Sequence Install with the following parameters:

-----------------------------------------------------

Load your appv template file

Remove vcreds capture from package

Run install.bat

-----------------------------------------------------

Package information:

-----------------------------------------------------

-- Machinescripts --

-- Userscripts --

 

-- Cleanup Package: (We just use tmedit cleanup to do this, see pictures for the things you could remove.

 

Picture 1

Picture 2

Picture 3

Delete files:

Delete installer cache from c:\windows\installer\ Save a lot of space by deleting msi from package

Delete the following registry settings:

Remove internet settings\zonemap from package

Package settings:

VFS write: on

-----------------------------------------------------------------------------

 

 

Added Scriptfiles:

Deleted registry values:

  

Deleted files:

    Root\VFS\AppVPackageDrive\Temp\spss26.log

    Root\VFS\Windows\Installer\5771e.msi

 

••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Install commandline (COMPLETE,ADD&PUBLISH&MOUNT):

                powershell.exe "Add-AppvClientPackage -Path 'Ibm Spss.appv' | Publish-AppvClientPackage –Global | Mount-AppvClientPackage"

 

AddPackage commandline (ADD&MOUNT):

                powershell.exe "Add-AppvClientPackage -Path 'Ibm Spss.appv' | Mount-AppvClientPackage"

 

PublishPackage commandline (PUBLISH&MOUNT):

                powershell.exe "Publish-AppvClientPackage -Name 'Ibm Spss' –Global | Mount-AppvClientPackage"

 

Uninstall commandline (COMPLETE,UNPUBLISH&REMOVE):

                powershell.exe "Unpublish-AppvClientPackage -Name 'Ibm Spss' -Global | Remove-AppVClientPackage"

 

UnpublishPackage commandline (UNPUBLISH):

                powershell.exe "Unpublish-AppvClientPackage -Name 'Ibm Spss' -Global"

 

UnpublishPackage commandline (UNPUBLISH):

                powershell.exe "Unpublish-AppvClientPackage -packageid 5ea38113-1b4b-4ff9-b6d6-77a997a300a8 -versionid 852d4686-932d-4a83-9cc0-1a36f4dea2f3 -global |Remove-AppvClientPackage"