locked
Launch App-V 5 applications by EXE name or Application name RRS feed

  • Question

  • Does anyone have any solution, or information, that will help me launch an App-V 5 Application by the Application Name (as displayed in get-appvclientapplication)?

    What I really want to do is use get-appvclientapplication to translate the name into an EXE and launch it.  However, if I can just launch the application directly (without knowing the , that would work too.

    I'm trying to simulate launching it from a shortcut when shortcuts are not possible.  I'm presenting the applications to users in a Citrix/Terminal Server environment, and the applications are presented seamlessly.  Therefore, users cannot click a shortcut to launch it, I have to configure the environment to launch a specific executable.

    Any help would be greatly appreciate!  


    Thanks!

    Tuesday, April 28, 2015 9:58 PM

Answers

  • For testing purpose I once created the following PoSh script to get the full real path of all published applications (on client level)... have a look, maybe you can modify and use it:

    $PackageInstallRoot = ((Get-AppvClientConfiguration -Name PackageInstallationRoot).Value -replace "%programdata%","${Env:programdata}")
    $oPackages = @()
    
    Get-AppvClientPackage | ForEach-Object {
            $oPackage = New-Object System.Object
            $oPackage | Add-Member -type NoteProperty –Name Package –Value $_.Name    
            $oApplications = @()  
           
            ForEach ($application in $_.GetApplications())        
            {
    
                $oApplication = New-Object System.Object
                $oApplication | Add-Member -type NoteProperty –Name Package –Value $_.Name
                $oApplication | Add-Member -type NoteProperty –Name Application –Value $application.Name
                $oApplication | Add-Member -type NoteProperty –Name RelPath –Value $application.TargetPath   
                
                #translate TargetPath to physical location   
                Write-Host $application.targetpath
                if ($application.targetpath -like "*AppVPackageRoot*")
                {
                    $TargetPath = (($application.targetpath -replace "AppVPackageRoot\}\]","") -replace "\[\{", ($PackageInstallRoot +"\"+ $_.PackageId +"\"+ $_.VersionId + "\Root"))
                    Write-Host $TargetPath -ForegroundColor Cyan
                }
                else
                {
                    $TargetPath = (($application.targetpath -replace "\}\]","") -replace "\[\{", ($PackageInstallRoot +"\"+ $_.PackageId +"\"+ $_.VersionId + "\Root\VFS\"))                               
                    Write-Host $TargetPath -ForegroundColor DarkYellow
                }
                $oApplication | Add-Member -type NoteProperty –Name AbslPath –Value $TargetPath
                $oApplications += $oApplication
            }
            
            $oPackage | Add-Member -type NoteProperty –Name Applications –Value $oApplications
            $oPackages += $oPackage
    }
    $oPackages.Applications | Select-Object Package, Application, RelPath, AbslPath | Sort-Object Package, Application | Out-GridView

    • Marked as answer by Joe.Robinson Wednesday, April 29, 2015 11:54 AM
    Wednesday, April 29, 2015 8:53 AM

All replies

  • For testing purpose I once created the following PoSh script to get the full real path of all published applications (on client level)... have a look, maybe you can modify and use it:

    $PackageInstallRoot = ((Get-AppvClientConfiguration -Name PackageInstallationRoot).Value -replace "%programdata%","${Env:programdata}")
    $oPackages = @()
    
    Get-AppvClientPackage | ForEach-Object {
            $oPackage = New-Object System.Object
            $oPackage | Add-Member -type NoteProperty –Name Package –Value $_.Name    
            $oApplications = @()  
           
            ForEach ($application in $_.GetApplications())        
            {
    
                $oApplication = New-Object System.Object
                $oApplication | Add-Member -type NoteProperty –Name Package –Value $_.Name
                $oApplication | Add-Member -type NoteProperty –Name Application –Value $application.Name
                $oApplication | Add-Member -type NoteProperty –Name RelPath –Value $application.TargetPath   
                
                #translate TargetPath to physical location   
                Write-Host $application.targetpath
                if ($application.targetpath -like "*AppVPackageRoot*")
                {
                    $TargetPath = (($application.targetpath -replace "AppVPackageRoot\}\]","") -replace "\[\{", ($PackageInstallRoot +"\"+ $_.PackageId +"\"+ $_.VersionId + "\Root"))
                    Write-Host $TargetPath -ForegroundColor Cyan
                }
                else
                {
                    $TargetPath = (($application.targetpath -replace "\}\]","") -replace "\[\{", ($PackageInstallRoot +"\"+ $_.PackageId +"\"+ $_.VersionId + "\Root\VFS\"))                               
                    Write-Host $TargetPath -ForegroundColor DarkYellow
                }
                $oApplication | Add-Member -type NoteProperty –Name AbslPath –Value $TargetPath
                $oApplications += $oApplication
            }
            
            $oPackage | Add-Member -type NoteProperty –Name Applications –Value $oApplications
            $oPackages += $oPackage
    }
    $oPackages.Applications | Select-Object Package, Application, RelPath, AbslPath | Sort-Object Package, Application | Out-GridView

    • Marked as answer by Joe.Robinson Wednesday, April 29, 2015 11:54 AM
    Wednesday, April 29, 2015 8:53 AM
  • That's pretty much what I came up with, too.  I was stuck on programs that were sequenced into VFS (which is everything now) -- I wasn't sure that just dropping the [{ and }] from the "token" names would be viable, but it looks good!

    Thanks for the confirmation and the code!  This is going to be very useful!

    Wednesday, April 29, 2015 11:56 AM