Hi, this package is causing me a nigthmare ...

I sequenced PSPICE 16 (orcad) app. This app has many folders with dlls and it set the environment in the manifest as:

<appv:Extension Category="AppV.EnvironmentVariables">
            <appv:EnvironmentVariables>
                <appv:Include>
                    <appv:Variable Name="HOME" Value="[{AppVPackageDrive}]\SPB_Data" />
                    <appv:Variable Name="CDSROOT" Value="[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite" />
                    <appv:Variable Name="PATH" Value="%PATH%;%CDSROOT%\tools\PSpice;%CDSROOT%\tools\Capture;%CDSROOT%\tools\bin;%CDSROOT%\OpenAccess\bin\win32\opt;%CDSROOT%\tools\fet\bin;%CDSROOT%\tools\pcb\bin" />
                </appv:Include>
            </appv:EnvironmentVariables>


This fails when launching some executables like pspice.exe with some dll missing. Procmon show that the path is ignored and it only search the system or user path.

Launching a cmd in the virtualized env of the app, the %CDSROOT% in the path isn't expanded, so I suppose that it may be that the PATH variable is processed before CDSROOT. So I edit the manifest xml in the packager in this way:

<appv:Extension Category="AppV.EnvironmentVariables">

            <appv:EnvironmentVariables>

                <appv:Include>

                    <appv:Variable Name="HOME" Value="[{AppVPackageDrive}]\SPB_Data" />

                    <appv:Variable Name="CDSROOT" Value="[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite" />

                    <appv:Variable Name="PATH" Value="%PATH%;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\PSpice;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\Capture;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\bin;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\OpenAccess\bin\win32\opt;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\fet\bin;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\pcb\bin" />

                </appv:Include>

            </appv:EnvironmentVariables>


After repackage and publish in the virtual CMD I see the PATH variable with the rigth content but pspice.exe don't find the dll's again. I read something about env variables in virtual registry in HKLM/Software/Microsoft/Windows/CurrentVersion/SessionManager... and again in the packager I see that PATH had the original value using %CDSROOT%, so I edit this and repackage again, but pspice.exe fails again finding the dlls.

The most curious thing is that in the virtual CMD the PATH variable is working for  .exe files but not for .dll ... It is very weird. Of course if I set the system PATH variable (or user PATH) with the pathname of all dirs (using the packageid, packageversion, vfs, etc). the app works.

What I'm doing wrong? Which is the best way to do it? I don't want to use App Paths because I have many executable apps in this package.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

1
Your best take this to www.appvirtguru.com

Your question is quite technical and I dont think this is the best place for it, as in this will be a quite long thread and not a one shot answer.

I'm active on that forum with some other peeps who are leaders (not me tho, lol!) in the field.

Try using sxstrace
Start the trace
Run the app
Stop the trace and convert the logs, they will give you an idea of what dll its trying to find and where hopefully.

Or you can shoot in the dark and start copying the missing DLLs to the exe folder location, when a exe is run, it always looks at the base location (where the exe is located) as part of the DLL lookup. Not the nest method, but does the job.

What you are trying to do is the proper method, you can also try adding the exe to the AppPaths - might work?

*just saw your apppath comment
* just saw your post there, lol.
Answered 07/21/2016 by: rileyz
Red Belt

Please log in to comment
1
looking over the information provided i would need confirmation of the version of app-v you're running


if youre running app-v 4.X the variable should be in the osd for the application and wont be substituted

E.g

<ENVLIST>
<ENVIRONMENT VARIABLE="PATH">%CSIDL_PROGRAM_FILES%\Microsoft Application Virtualization Sequencer\;%PATH%;C:\Oracle\Middleware\EPMSystem11R1\bin;</ENVIRONMENT>
<ENVIRONMENT VARIABLE="EPM_ORACLE_HOME">C:\Oracle\Middleware\EPMSystem11R1\</ENVIRONMENT>
</ENVLIST>

if youre on app-v 5.0 it will be located in your deployment/user_config.xml

e.g

      <EnvironmentVariables Enabled="true">
        <Include>
          <Variable Name="test" Value="[{AppVPackageDrive}]\test" />
          <Variable Name="PATH" Value="%PATH%;[{AppVPackageDrive}]\test" />
        </Include>

there are various ways at attacking this, some applications (namely of the apple variant <.< ) ignore path keys in the package even if they expand out when checking inside the package. 

what you can do is enable PVAD and and set the PVAD to the directory containing your DLL files, this will register it as a primary path that the app-v application will direct initial requests to before checking the local area's for the files and will result in the application continuing past an error.

Other instances require something a lot less clean and that would be doing as Rileyz suggested by dropping the missing files into the same directory as the 

Answered 07/28/2016 by: sparky86
Fourth Degree Brown Belt

Please log in to comment
0
Thanks for all answers, but it seem that APPV isn't working very well in this case ...

This is my DeploymentConfig

<EnvironmentVariables Enabled="true">
        <Include>
          <Variable Name="HOME" Value="[{AppVPackageDrive}]\SPB_Data" />
          <Variable Name="CDSROOT" Value="[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite" />
          <Variable Name="PATH" Value="%PATH%;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\PSpice;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\Capture;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\bin;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\OpenAccess\bin\win32\opt;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\fet\bin;[{ProgramFilesX64}]\Orcad\Orcad_16.6_Lite\tools\pcb\bin" />
        </Include>

This is echo %PATH% in a cmd.exe launching inside virtualized enviromnment (I launch this cmd.exe usion App-V commander:



This is the procmon output when I run pspice from the last cmd (note that the path is working here because I'm not in the dir with pspice.exe:



As you can see, cdn_og1101as.dll is searched in all dirs from PATH but it always returns PATH NOT FOUND

I copy from procmon the path with "C:\Program Files\Orcad\Orcad_16.6_Lite\tools\bin\cdn_og1101as.dll" and paste in the previous cmd and this is the output:



As you can see, pspice.exe doesn't found this file in the same path but the cmd.exe in the virtualized env find it ... It's a bug or something that I can't see?

Answered 07/29/2016 by: tonin
White Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share