pmears
Contributor
Contributor

Building upon the suggestion of Michael (Theike), I scrapped all my original plans and went for a simple solution.  The key was knowing that once packaged, and entry point's exe can accept runtime parameters passed via command line or shortcut.  It should also be noted that in order for the packaged .exe to accept parameters, the ComandLine option must be removed/ignored/commented.  I also commented the WorkingDirectory since that is also defined in the shortcut on the host.

My package.ini file Entry Point now looks like this:

[Client.exe]
Version.ProductName=Client Runtime, v3
Version.Description=Uses Application Virtualization
Shortcut=runtime.dat
Source=#25drive_C#25\Client\bin\ifrun60.EXE
;Change ReadOnlyData to bin\Package.ro.tvr to build with old versions(4.6.0 or earlier) of tools
;WorkingDirectory=#25drive_C#25\Client\FORMS
;CommandLine="#25drive_C#25\Client\bin\ifrun60.EXE"
Icon=%drive_C%\inFRONT\iDSDB\INFRONT.ico
Shortcuts=%Desktop%;%StartMenu%
Disabled=0

On the host, I created a shortcut with the following:

TARGET:  <PATH_TO_EXE>\client.exe <PATH_TO_FORMS>\form.fmx

WORKING:  <PATH_TO_FORMS>

I also solved the need for customization and scripting for the associated TNSNAMES.ORA file, again looking for the "easy button."  I began by removing the %drive_C%\Client\TNS_ADMIN folder from the ThinApp project altogether.  I also made sure that the isolation mode was Merged or WriteCopy.  Next, I added a single piece of VBS code.

Function OnFirstSandboxOwner
  ' Get the full path of ThinApp executable.  Also includes name of executable file (runtime.dat)
  Origin = GetEnvironmentVariable("TS_ORIGIN")
 
  ' Remote the executable file name from the origin variable, leaves trailing slash
  LastSlash = InStrRev(Origin, "\")
  SourcePath = Left(Origin, LastSlash)
 
  ' Define the path to TNS_ADMIN
  tnsPath = SourcePath & "TNS_ADMIN\"
 
  ' Set the TNS_ADMIN environment variable
  SetEnvironmentVariable "TNS_ADMIN", tnsPath
End Function

This script will set an environment variable within the virtualized environment to the full path of the entry point exe.  This allows the TNS_ADMIN to be copied / installed anywhere on the system.

If I have any advice for others, it would be to KISS (Keep It Simple, St**pid) - don't get excited by all the advanced stuff that ThinApp might be capable of while all the time forgetting that it may not be necessary.

For those with extensive ThinApp experience all of this might have seemed like second nature, but for a beginner I felt a huge sense of accomplishment upon completing this build. We are all now testing the packages against different evironments and plan to push to clients within a month.

As a side benfit, this process has shrunken the size of the client installation ISO used to distribute those files needed to get our client running from 900+ MB to < 50 MB.

Reply
0 Kudos