Packaging Process for Kdenlive
Version 17.08.1

SUMMARY
This post outlines the process for Packaging Kdenlive Video editor.
Obtain Package Source
Download the main source files from kdenlive.org.
Create Package and add plugins
As per instructions in the screenshot above, follow the steps to add H264/265 functionality.
Extract to your package folder, in sub-directory ProgramFiles\Kdenlive-17.08.1.
Create a shortcut manually and copy to your package folder. You can use the file ProgramFiles\Kdenlive-17.08.1\data\banner.png as an icon if you edit it to make it square and save as kdenlive.ico. Copy the icon file to ProgramFiles\Kdenlive-17.08.1.
Create Scripts for Install and Uninstall
Create or update a set of text-based scripts as per below with the contents provided. When complete, copy the unInstall.ps1 script into ProgramFiles\Kdenlive-17.08.1.

Install
The installer is a Powershell script. It will install the files, create a Start Menu shortcut and registry entries for Add/Remove Programs.
Install.ps1
# Powershell script to uninstall Adobe Flash NPAPI plugin 28.0.0.137 for Firefox
# Created 20/11/2017 | cru2.io
# Set Variables
$CurrentPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$RegPath = “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Kdenlive 17.08.1”
$AppPath = “C:\Program Files\Kdenlive-17.08.1”
$MenuPath = “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Kdenlive”
#Install
# check and create program and start menu folders and copy program
If (!(Test-Path $AppPath))
{
New-Item -ItemType Directory $AppPath -force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
}
If (Test-Path $AppPath)
{
Copy-Item “$CurrentPath\ProgramFiles\Kdenlive-17.08.1\*” $AppPath\ -Recurse -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
}
If (!(Test-Path $MenuPath))
{New-Item -ItemType Directory $MenuPath -force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null}
If (!(Test-Path $MenuPath\Kdenlive.lnk))
{Copy-Item “$CurrentPath\Kdenlive.lnk” $MenuPath\Kdenlive.lnk -force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null}
# check and create program registry entries
If (!(Test-Path $RegPath))
{
New-Item -ItemType Directory $RegPath -force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
New-ItemProperty -Path $RegPath -Name “DisplayName” -Value “Kdenlive 17.08.1” -force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
New-ItemProperty -Path $RegPath -Name “DisplayVersion” -Value “17.08.1” -force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
New-ItemProperty -Path $RegPath -Name “DisplayIcon” -Value “C:\Program Files\Kdenlive-17.08.1\kdenlive.ico” -force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
New-ItemProperty -Path $RegPath -Name “UninstallString” -Value “powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File `”$AppPath\unInstall.ps1`”” -force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
}
Uninstall
The uninstaller is a Powershell script.
unInstall.ps1
# Powershell script to uninstall Adobe Flash NPAPI plugin 28.0.0.137 for Firefox
# Created 20/11/2017 | cru2.io
# Set Variables
$CurrentPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$RegPath = “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Kdenlive 17.08.1”
$AppPath = “C:\Program Files\Kdenlive-17.08.1”
$MenuPath = “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Kdenlive”
# End Program
kill -processname kdenlive,dbus-daemon -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
# unInstall
If (Test-Path $MenuPath)
{Remove-Item $MenuPath -Recurse -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null}
If (Test-Path $AppPath)
{Remove-Item $AppPath -Recurse -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null}
If (Test-Path $RegPath)
{Remove-Item $RegPath -Recurse -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null}
Uninstall registry key
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Kdenlive 17.08.1]
“DisplayName”=”Kdenlive 17.08.1”
“DisplayVersion”=”17.08.1”
“DisplayIcon”=”C:\\Program Files\\Kdenlive-17.08.1\\kdenlive.ico”
“UninstallString”=”powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File \”C:\\Program Files\\Kdenlive-17.08.1\\unInstall.ps1\””