Skip to content

Conversation

@Trouffman
Copy link
Collaborator

This PR aim to solve challenge with:

  • Installation challenge when upgrading from OBS-NDI to DistroAV
  • Reduce support request due to uncommon instillation path
  • Simplify Upgrade Process for Windows

Target Usage:

  • Windows Installer

The PR use

  • Self-contained script (PASCAL) in the InnoSetup process

Expected behavior:

  • Identify the location of the uninstaller for OBS-NDI
  • Trigger a silent uninstall
  • Install DistroAV
  • Remove left-over files & directory
  • obs-ndi.dll
  • obs-ndi.pdb
  • obs-ndi data folder (used to store translations files)

Some notes (useful for general knowledge and future reference):

Use of InnoSetup [InstallDelete] Section

Official Doc says this is processed as a first step in the installation process.

  • It Delete the known obs-ndi files
  • This also delete files that where manually installed

This is a step to discuss! While this target exclusively obs-ndi files, we should highlight it.

If no uninstaller can be found this will proceed with regular installation

Leverage the [Run] Section to trigger the uninstall of OBS-NDI if the uninstaller path is known after the installation.

  1. Look up in registry if the unsintaller for OBS-NDI exists
  2. Execute the known uninstaller silently

Why the need for a Check and not use "Flags: skipifdoesntexist"

Flags: skipifdoesntexist only support absolute Path and will not work with dynamic path.

Tested:

  • Windows 11
  • OBS-NDI 4.11 / 4.12 / 4.13 / 4.14

@BitRate27
Copy link
Contributor

I have also confirmed it works back to 4.11, however if I install 4.10, it will remove the dll but will not uninstall. This is where 4.10 is in the registry: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall{CD703FE5-1F2C-4837-BD3D-DD840D83C3E3}_is1

@Trouffman
Copy link
Collaborator Author

Trouffman commented Nov 7, 2024

I think we could dismiss anything prior to 4.11 this is pre-march 2023 and pred NDI 5.

This is because pre-4.11 it was a different AppID.

@Trouffman
Copy link
Collaborator Author

Suggestion: release this as 6.0.1 to avoid most of the issues / support request when user do not follow completely the uninstall steps.

@Trouffman Trouffman changed the title Autoremove obs ndi Auto remove obs-ndi - Windows Nov 8, 2024
@Trouffman Trouffman changed the base branch from master to develop November 8, 2024 20:29
end;


// Remove old OBS-NDI conflicting plugin - by Trouffman for DistroA https://github.com/DistroAV/DistroAV/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor typo

// Remove old OBS-NDI conflicting plugin - by Trouffman for DistroA https://github.com/DistroAV/DistroAV/

// CAREFUL : this target the old AppID.
const UninstallRegisterPath = 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{A9039243-4FE7-45E7-8B11-7DC1ACB67B9D}_is1';
Copy link
Member

@paulpv paulpv Nov 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we know other older obs-ndi guids, why not also add those here?
@BitRate27 said 4.10 is HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall{CD703FE5-1F2C-4837-BD3D-DD840D83C3E3}_is1, but I think the WOW6432 part can be skipped and just the guid used.

Type: files; Name: "{app}\obs-plugins\64bit\obs-ndi.pdb"

[Run]
; This uninstall the old obs-ndi after installation but before the final dialog when installing DistroAV
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; This uninstalls the old obs-ndi after installing DistroAV but before the final dialog

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes much more sense!

Copy link
Member

@paulpv paulpv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with the code, but there are a few tiny minor typos or grammatical errors.
I'm not qualified to criticize the Pascal code; I haven't coded Pascal since 1991!
(Pascal was my first compiled code language)
The code looks a little odd/foreign to me, but that may just be inherent to Pascal.

@paulpv
Copy link
Member

paulpv commented Nov 10, 2024

The code seems fine.
It would be cool to add and support the 4.10 guid of {CD703FE5-1F2C-4837-BD3D-DD840D83C3E3} since we know it, but I agree that this is not a big deal.

I had originally considered doing this...
image
...but I avoided it because I wanted to keep our code as close to https://github.com/obsproject/obs-plugintemplate as possible and figured users would be able to follow instructions. ;)

@Trouffman
Copy link
Collaborator Author

Trouffman commented Nov 12, 2024

Last commit should address the 4.10 and also fix some naming weirdness.

// Check primary registry location
if ( RegQueryStringValue(HKLM, UninstallRegisterPath, 'UninstallString', UninstallerPathRegistry) ) then
// Check primary registry location version 4.11+
if ( RegQueryStringValue(HKLM, UninstallRegisteryPath411up, 'UninstallString', UninstallerPathRegistry) ) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for there to be some install/update/uninstall bug and someone have both <= 4.10 and >= 4.11 installed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not expected.
The way PASCAL script work is as follow:

  • The first match of a If statement with "exit" that statement.

In our example:

  • if someone has any post 4.11 installed -> this will be removed.
  • if they do not have the 4.11 but >= 4.10 it will remove it.

Anyone before 4.10 is out of support for over a year an half, this is not supported and that user will have to manually deal with it. At this point there is jsu tso much that can be done :D

If a user has both 4.10 and 4.11+ installed at a time (could be if installed in 2 different locations) The install will remove OBS NDI 4.11, skip any other. At launch the user will see the error that obs-ndi is installed : if it run the distroav installer again : this will remove 4.10.

@paulpv
Copy link
Member

paulpv commented Nov 12, 2024

While we are touching this file, please change line 1 from:

#define MyAppName "@CMAKE_PROJECT_NAME@"

to

#define MyAppName "@PLUGIN_DISPLAY_NAME@"

@Trouffman Trouffman removed the request for review from RayneYoruka November 13, 2024 16:16
@DistroAV DistroAV deleted a comment from BitRate27 Nov 13, 2024
@Trouffman Trouffman merged commit 3d4fb2d into develop Nov 17, 2024
@Trouffman Trouffman deleted the autoremove-obs-ndi branch November 17, 2024 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants