R-Studio 0.99
I haven't been able to "package" R-Studio in app-v 5.0 (Sp3) the main windows stay white
But R is fully virtualisable I decided to "install" R-Studio on the R package Add-Package trigger and configure the RDesktop.ini on the fly to point on the virtualised R x86 location.
Appv 5.0 XML
<MachineScripts>
<AddPackage>
<Path>Powershell.exe</Path>
<Arguments>-File [{AppVPackageRoot}]\..\Scripts\RStudio_Remove-Install.ps1</Arguments>
<Wait RollbackOnError="false" Timeout="250"/>
</AddPackage>
</MachineScripts>
<UserScripts>
<PublishPackage>
<Path>Powershell.exe</Path>
<Arguments>-File [{AppVPackageRoot}]\..\Scripts\RStudio_Config_X64_R_i386.ps1</Arguments>
<Wait RollbackOnError="false" Timeout="120"/>
</PublishPackage>
</UserScripts>
RStudio_Remove-Install.ps1 (will remove old R-Studio version then install the new one)
#Configure Strings
[String]$RstudioRemoveCommand = "C:\Program Files\RStudio\Uninstall.exe"
[String]$RstudioRemoveParam = "/S"
[String]$ScriptPath = Split-Path $MyInvocation.InvocationName
[String]$RstudioInstallCommand = "$($ScriptPath)\RStudio-0.99.473.exe"
[String]$RstudioInstallParam = "/S /D='C:\Program Files\RStudio\bin'"
if (Test-Path $RstudioRemoveCommand) {
Start-process -FilePath $RstudioRemoveCommand -ArgumentList $RstudioRemoveParam -Wait -NoNewWindow
}
if (Test-Path $RstudioInstallCommand){
Start-Process -FilePath $RstudioInstallCommand -ArgumentList $RstudioInstallParam -Wait -NoNewWindow
}
RStudio_Config_X64_R_i386.ps1
Function FindAndReplace {
Param(
[String]$Find,
[String]$Replace,
[String]$FileNameIn,
[String]$FileNameOut=""
)
if ($FileNameOut -like "") {$FileNameOut = $FileNameIn}
$content = Get-Content($FileNameIn)
$content = $content.replace($Find,$Replace)
$OutPath = Split-Path $FileNameOut
$PathExist = Test-Path $OutPath
if ($PathExist -eq $false) {
Write-Verbose "Creating $($OutPath)"
$MyDir = New-Item -ItemType directory -Path $OutPath
Write-Verbose "$($MyDir.FullName) Created"
}
$content | out-file $FileNameOut -encoding default -Force
}
[String]$ScriptPath = Split-Path $MyInvocation.InvocationName
[String]$AppData = $env:APPDATA
[String]$RStudioConfigOut = $AppData + "\Rstudio\Desktop.ini"
[String]$RStudioConfigIn = $ScriptPath + "\Desktop.ini"
[String]$ToRempl = "RDIRECTORY"
[String]$RootPath = Split-Path -Parent $ScriptPath
[String]$RDirectory = $RootPath + "\Root\VFS\ProgramFilesX64\R\R-3.2.2\bin\i386\"
$RDirectory = $RDirectory.replace("\","/")
FindAndReplace -Find $ToRempl -Replace $RDirectory -FileNameIn $RStudioConfigIn -FileNameOut $RStudioConfigOut
Desktop.ini
[General]
RBinDir=RDIRECTORY
PreferR64=false
Rstudio software is installed from a setup executable and has both 32 bit and 64 bit components that can be installed in isolation or together to the same platform depending on your requirements.
RStudio requires the location of the installation of 'R' and if virtualising each application separately using App-V should use Dynamic Suite Composition to allow RStudio & R to communicate with one another. An observation would be that although manual installations of RStudio detect installations to the physical file system in the shortfile name location C:\Progra~1\Rstudio when calling the R_HOME variable; in a virtual file system with the latest 4.6 appv client (SP1 & SP2) this location does not reflect the installation in it's shortfile name path. Is is only visible in C:\Program Files\Rstudio and RStudio doesn't handle spaces in the path well. To mitigate this in an appv package the path can be redirected by setting the RBindir value in %APPDATA%\rstudio\desktop.ini to the VFS location such as S:\Rxxxxxxx.001\VFS\PROGRAM_FILES_X64\R\R-2.15.2\
Another point to note if capturing both platform components is that this desktop.ini file can only hold one value for the OS specific R location and therefore to avoid users having to navigate to the correct path in the VFS to use the alternative R installation location, this can be automated. One suggestion would be to re-direct the shortcuts to a scripts which copy a OS specific pre-configured desktop.ini in to the %APPDATA%\Rstudio folder before launching Rstudio which proved effective.
Use <OS VALUE="Win764"/> on RStudio x64 shortcut OSD files so that they don't appear on 32 bit specific Operating systems.
View inventory records anonymously contributed by opt-in users of the K1000 Systems Management Appliance.
Byron - runBy 8 years ago