Skip to main content

I had success to make a program selectable (and use default) in open withOpen With context menu. The solution above is working well but usually users don't want to use context menu at every time instead associate to file type. As we are in a managed environment and not automatically associate anything via SCCM deployment therefore a small workaround could be:

First explored some reason even our app in virtual HKCR\Applicatons\something.exeHKCR\Applicatons\something.exe could not be selected from open withOpen With after published to user. I made the following powershellPowerShell script and the trick will be done when running at add-package as run in machine-context and put necessary data into native registry. Yes, this script could be easier and more transparent, but for testing purposes should be fine for first shot:

$ConnectorScriptRootPath = Split-Path -Path ((Get-Variable MyInvocation).Value).MyCommand.Path -Parent

$ConnectorRootPath = Split-Path -Path $ConnectorScriptRootPath -Parent

$OWExecutable = """" + $ConnectorRootPath + "\Root\VFS\ProgramFilesX64\VLC\vlc.exe" + """" + " --started-from-file " + """" + "%1" + """"

New-Item -Path HKLM:\Software\Classes\Applications -Name vlc.exe –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe -Name shell –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell -Name Open –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Name Command –Force

New-ItemProperty -Path HKLM:\Software\Classes\Applications\vlc.exe -Name "FriendlyAppName" -Value "VLC Media Player" -PropertyType String -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Value "Play with VLC Media Player" -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open\Command -Value $OWExecutable -Force

$ConnectorScriptRootPath = Split-Path -Path ((Get-Variable MyInvocation).Value).MyCommand.Path -Parent

$ConnectorRootPath = Split-Path -Path $ConnectorScriptRootPath -Parent

$OWExecutable = """" + $ConnectorRootPath + "\Root\VFS\ProgramFilesX64\VLC\vlc.exe" + """" + " --started-from-file " + """" + "%1" + """"

New-Item -Path HKLM:\Software\Classes\Applications -Name vlc.exe –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe -Name shell –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell -Name Open –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Name Command –Force

New-ItemProperty -Path HKLM:\Software\Classes\Applications\vlc.exe -Name "FriendlyAppName" -Value "VLC Media Player" -PropertyType String -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Value "Play with VLC Media Player" -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open\Command  -Value $OWExecutable -Force

And I place this file into script directory: [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1

[{AppVPackageRoot}]\..\Scripts\VLC_AddPackage.ps1

After sequenced and in package editor I exported the manifest file and opened with App-V Manifest Editor from TMUrgent solution. In manifest editor I went to scripts/machine scripts/Add-packagescripts/machine scripts/Add-package and set:

Path: PowerShell.exePowerShell.exe
Arguments: -executionpolicy bypass [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1

wait-executionpolicy bypass [{AppVPackageRoot}]\..\Scripts\VLC_AddPackage.ps1
wait: true

Timeouttrue
Timeout:3030

Be careful with AppvEnvvarsAppvEnvvars have to be as above: [{AppVPackageRoot}][{AppVPackageRoot}] Be careful with wait,wait: if script will wentgoes wrong and there areis no timeout then you could be in an unwanted situation.

After adding the package (and publishing) the package, it can be browsed from more applicationapplications in open WithOpen With and the user can be set it up as a default one. 

Here not mentioned but take care when removing the packagepackage; there should be another script which removes entries added when publishing.

Hope this helps,.

I had success to make a program selectable (and use default) in open with context menu. The solution above is working well but usually users don't want to use context menu at every time instead associate to file type. As we are in a managed environment and not automatically associate anything via SCCM deployment therefore a small workaround could be:

First explored some reason even our app in virtual HKCR\Applicatons\something.exe could not be selected from open with after published to user. I made the following powershell script and the trick will be done when running at add-package as run in machine-context and put necessary data into native registry. Yes this script could be easier and more transparent, but for testing purposes should be fine for first shot:

$ConnectorScriptRootPath = Split-Path -Path ((Get-Variable MyInvocation).Value).MyCommand.Path -Parent

$ConnectorRootPath = Split-Path -Path $ConnectorScriptRootPath -Parent

$OWExecutable = """" + $ConnectorRootPath + "\Root\VFS\ProgramFilesX64\VLC\vlc.exe" + """" + " --started-from-file " + """" + "%1" + """"

New-Item -Path HKLM:\Software\Classes\Applications -Name vlc.exe –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe -Name shell –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell -Name Open –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Name Command –Force

New-ItemProperty -Path HKLM:\Software\Classes\Applications\vlc.exe -Name "FriendlyAppName" -Value "VLC Media Player" -PropertyType String -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Value "Play with VLC Media Player" -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open\Command -Value $OWExecutable -Force

And I place this file into script directory: [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1

After sequenced and in package editor I exported the manifest file and opened with App-V Manifest Editor from TMUrgent solution. In manifest editor I went to scripts/machine scripts/Add-package and set:

Path: PowerShell.exe Arguments: -executionpolicy bypass [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1

wait: true

Timeout:30

Be careful with AppvEnvvars have to be as above: [{AppVPackageRoot}] Be careful with wait, if script will went wrong and there are no timeout then you could be in an unwanted situation.

After adding the package (and publishing) it can be browsed from more application in open With and the user can be set it up as a default one. Here not mentioned but take care when removing the package there should be another script which removes entries added when publishing.

Hope this helps,

I had success to make a program selectable (and use default) in Open With context menu. The solution above is working well but usually users don't want to use context menu at every time instead associate to file type. As we are in a managed environment and not automatically associate anything via SCCM deployment therefore a small workaround could be:

First explored some reason even our app in virtual HKCR\Applicatons\something.exe could not be selected from Open With after published to user. I made the following PowerShell script and the trick will be done when running at add-package as run in machine-context and put necessary data into native registry. Yes, this script could be easier and more transparent, but for testing purposes should be fine for first shot:

$ConnectorScriptRootPath = Split-Path -Path ((Get-Variable MyInvocation).Value).MyCommand.Path -Parent

$ConnectorRootPath = Split-Path -Path $ConnectorScriptRootPath -Parent

$OWExecutable = """" + $ConnectorRootPath + "\Root\VFS\ProgramFilesX64\VLC\vlc.exe" + """" + " --started-from-file " + """" + "%1" + """"

New-Item -Path HKLM:\Software\Classes\Applications -Name vlc.exe –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe -Name shell –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell -Name Open –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Name Command –Force

New-ItemProperty -Path HKLM:\Software\Classes\Applications\vlc.exe -Name "FriendlyAppName" -Value "VLC Media Player" -PropertyType String -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Value "Play with VLC Media Player" -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open\Command  -Value $OWExecutable -Force

And I place this file into script directory:

[{AppVPackageRoot}]\..\Scripts\VLC_AddPackage.ps1

After sequenced and in package editor I exported the manifest file and opened with App-V Manifest Editor from TMUrgent solution. In manifest editor I went to scripts/machine scripts/Add-package and set:

Path: PowerShell.exe
Arguments: -executionpolicy bypass [{AppVPackageRoot}]\..\Scripts\VLC_AddPackage.ps1
wait: true
Timeout:30

Be careful with AppvEnvvars have to be as above: [{AppVPackageRoot}] Be careful with wait: if script goes wrong and there is no timeout then you could be in an unwanted situation.

After adding (and publishing) the package, it can be browsed from more applications in Open With and the user can be set it up as a default one. 

Here not mentioned but take care when removing the package; there should be another script which removes entries added when publishing.

Hope this helps.

added 4 characters in body
Source Link

For those who are still having the same issue when deploying app via APP-V 5x:

I had success to make a program selectable (and use default) in open with context menu. The solution above is working well but usually users don't want to use context menu at every time instead associate to file type. As we are in a managed environment and not automatically associate anything via SCCM deployment therefore a small workaround could be:

First explored some reason even our app in virtual HKCR\Applicatons\something.exe could not be selected from open with after published to user. I made the following powershell script and the trick will be done when running at add-package as run in machine-context and put necessary data into native registry. Yes this script could be easier and more transparent, but for testing purposes should be fine for first shot:

$ConnectorScriptRootPath = Split-Path -Path ((Get-Variable MyInvocation).Value).MyCommand.Path -Parent

$ConnectorRootPath = Split-Path -Path $ConnectorScriptRootPath -Parent

$OWExecutable = """" + $ConnectorRootPath + "\Root\VFS\ProgramFilesX64\VLC\vlc.exe" + """" + " --started-from-file " + """" + "%1" + """"

New-Item -Path HKLM:\Software\Classes\Applications -Name vlc.exe –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe -Name shell –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell -Name Open –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Name Command –Force

New-ItemProperty -Path HKLM:\Software\Classes\Applications\vlc.exe -Name "FriendlyAppName" -Value "VLC Media Player" -PropertyType String -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Value "Play with VLC Media Player" -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open\Command -Value $OWExecutable -Force

And I place this file into script directory: [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1

After sequenced and in package editor I exported the manifest file and opened with App-V Manifest Editor from TMUrgent solution. In manifest editor I went to scripts/machine scripts/Add-package and set:

Path: PowerShell.exe Arguments: -executionpolicy bypass [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1 wait

wait: true Timeout

Timeout:30

Be careful with AppvEnvvars have to be as above: [{AppVPackageRoot}] Be careful with wait, if script will went wrong and there are no timeout then you could be in an unwanted situation.

After adding the package (and publishing) it can be browsed from more application in open With and the user can be set it up as a default one. Here not mentioned but take care when removing the package there should be another script which removes entries added when publishing.

Hope this helps,

For those who are still having the same issue when deploying app via APP-V 5x:

I had success to make a program selectable (and use default) in open with context menu. The solution above is working well but usually users don't want to use context menu at every time instead associate to file type. As we are in a managed environment and not automatically associate anything via SCCM deployment therefore a small workaround could be:

First explored some reason even our app in virtual HKCR\Applicatons\something.exe could not be selected from open with after published to user. I made the following powershell script and the trick will be done when running at add-package as run in machine-context and put necessary data into native registry. Yes this script could be easier and more transparent, but for testing purposes should be fine for first shot:

$ConnectorScriptRootPath = Split-Path -Path ((Get-Variable MyInvocation).Value).MyCommand.Path -Parent

$ConnectorRootPath = Split-Path -Path $ConnectorScriptRootPath -Parent

$OWExecutable = """" + $ConnectorRootPath + "\Root\VFS\ProgramFilesX64\VLC\vlc.exe" + """" + " --started-from-file " + """" + "%1" + """"

New-Item -Path HKLM:\Software\Classes\Applications -Name vlc.exe –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe -Name shell –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell -Name Open –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Name Command –Force

New-ItemProperty -Path HKLM:\Software\Classes\Applications\vlc.exe -Name "FriendlyAppName" -Value "VLC Media Player" -PropertyType String -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Value "Play with VLC Media Player" -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open\Command -Value $OWExecutable -Force

And I place this file into script directory: [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1

After sequenced and in package editor I exported the manifest file and opened with App-V Manifest Editor from TMUrgent solution. In manifest editor I went to scripts/machine scripts/Add-package and set:

Path: PowerShell.exe Arguments: -executionpolicy bypass [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1 wait: true Timeout:30

Be careful with AppvEnvvars have to be as above: [{AppVPackageRoot}] Be careful with wait, if script will went wrong and there are no timeout then you could be in an unwanted situation.

After adding the package (and publishing) it can be browsed from more application in open With and the user can be set it up as a default one. Here not mentioned but take care when removing the package there should be another script which removes entries added when publishing.

Hope this helps,

For those who are still having the same issue when deploying app via APP-V 5x:

I had success to make a program selectable (and use default) in open with context menu. The solution above is working well but usually users don't want to use context menu at every time instead associate to file type. As we are in a managed environment and not automatically associate anything via SCCM deployment therefore a small workaround could be:

First explored some reason even our app in virtual HKCR\Applicatons\something.exe could not be selected from open with after published to user. I made the following powershell script and the trick will be done when running at add-package as run in machine-context and put necessary data into native registry. Yes this script could be easier and more transparent, but for testing purposes should be fine for first shot:

$ConnectorScriptRootPath = Split-Path -Path ((Get-Variable MyInvocation).Value).MyCommand.Path -Parent

$ConnectorRootPath = Split-Path -Path $ConnectorScriptRootPath -Parent

$OWExecutable = """" + $ConnectorRootPath + "\Root\VFS\ProgramFilesX64\VLC\vlc.exe" + """" + " --started-from-file " + """" + "%1" + """"

New-Item -Path HKLM:\Software\Classes\Applications -Name vlc.exe –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe -Name shell –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell -Name Open –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Name Command –Force

New-ItemProperty -Path HKLM:\Software\Classes\Applications\vlc.exe -Name "FriendlyAppName" -Value "VLC Media Player" -PropertyType String -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Value "Play with VLC Media Player" -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open\Command -Value $OWExecutable -Force

And I place this file into script directory: [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1

After sequenced and in package editor I exported the manifest file and opened with App-V Manifest Editor from TMUrgent solution. In manifest editor I went to scripts/machine scripts/Add-package and set:

Path: PowerShell.exe Arguments: -executionpolicy bypass [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1

wait: true

Timeout:30

Be careful with AppvEnvvars have to be as above: [{AppVPackageRoot}] Be careful with wait, if script will went wrong and there are no timeout then you could be in an unwanted situation.

After adding the package (and publishing) it can be browsed from more application in open With and the user can be set it up as a default one. Here not mentioned but take care when removing the package there should be another script which removes entries added when publishing.

Hope this helps,

Source Link

For those who are still having the same issue when deploying app via APP-V 5x:

I had success to make a program selectable (and use default) in open with context menu. The solution above is working well but usually users don't want to use context menu at every time instead associate to file type. As we are in a managed environment and not automatically associate anything via SCCM deployment therefore a small workaround could be:

First explored some reason even our app in virtual HKCR\Applicatons\something.exe could not be selected from open with after published to user. I made the following powershell script and the trick will be done when running at add-package as run in machine-context and put necessary data into native registry. Yes this script could be easier and more transparent, but for testing purposes should be fine for first shot:

$ConnectorScriptRootPath = Split-Path -Path ((Get-Variable MyInvocation).Value).MyCommand.Path -Parent

$ConnectorRootPath = Split-Path -Path $ConnectorScriptRootPath -Parent

$OWExecutable = """" + $ConnectorRootPath + "\Root\VFS\ProgramFilesX64\VLC\vlc.exe" + """" + " --started-from-file " + """" + "%1" + """"

New-Item -Path HKLM:\Software\Classes\Applications -Name vlc.exe –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe -Name shell –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell -Name Open –Force

New-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Name Command –Force

New-ItemProperty -Path HKLM:\Software\Classes\Applications\vlc.exe -Name "FriendlyAppName" -Value "VLC Media Player" -PropertyType String -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open -Value "Play with VLC Media Player" -Force

Set-Item -Path HKLM:\Software\Classes\Applications\vlc.exe\shell\Open\Command -Value $OWExecutable -Force

And I place this file into script directory: [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1

After sequenced and in package editor I exported the manifest file and opened with App-V Manifest Editor from TMUrgent solution. In manifest editor I went to scripts/machine scripts/Add-package and set:

Path: PowerShell.exe Arguments: -executionpolicy bypass [{AppVPackageRoot}]..\Scripts\VLC_AddPackage.ps1 wait: true Timeout:30

Be careful with AppvEnvvars have to be as above: [{AppVPackageRoot}] Be careful with wait, if script will went wrong and there are no timeout then you could be in an unwanted situation.

After adding the package (and publishing) it can be browsed from more application in open With and the user can be set it up as a default one. Here not mentioned but take care when removing the package there should be another script which removes entries added when publishing.

Hope this helps,