- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Variable Entry Point
I have created a package for an Oracle 6i Client Runtime application. The package.ini file has identified the entry point (correctly) as:
[Client.exe]
Version.ProductName=Oracle Client Runtime, v3
Version.Description=Uses Application Virtualization
Shortcut=runtime.dat
Source=#25drive_C#25\ORANT\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\FORMS\
CommandLine="#25drive_C#25\ORANT\BIN\ifrun60.EXE" C:\FORMS\form5.fmx
Icon=%drive_C%\FORMS\icon.ico
Shortcuts=%Desktop%
ifrun60.exe can be passed parameters at runtime, specifically the path and filename of the FMX file which it should open.
It is this parameter that I would like to become variable.
I have sucessfully implemented a "startup.vbs" script that is built along with the package. My script has the following structure (I have replaced certain code with pseudo-code):
Function OnFirstSandboxOwner
' execute ts_origin subroutine
' if the config file is found on %drive_c% then
' execute worker subroutine
' else exit
End Function
Sub ts_origin
' copy config file from thinapp run folder and copy to %drive_c%
' taken from vmware example code
End Sub
Sub worker
' read contents from config.ini into variables
' generate tnsnames.ora file from variables onto %drive_c%
End Sub
Everything in my script is now working and doing what I expect it to but I still need to determine how to create an entry point (or some other solution) that allows me to dynamically create the runtime parameter.
In my config.ini file, I have the following section - which would match the default entry point
[FORMS]
type=local
path=C:\FORMS\
name=form5.fmx
but the config.ini file could be updated to
[FORMS]
type=network
path=\\1.2.3.4\forms_dir
name=form10.fmx
in which case the entry point should be changed to:
WorkingDirectory=\\1.2.3.4\forms_dir
CommandLine="#25drive_C#25\ORANT\BIN\ifrun60.EXE" \\1.2.3.4\forms_dir\form10.fmx
I read somewhere that maybe including WSCRIPT.EXE as an entry point would be beneficial and I could launch the appropriate command via a second vbScript. Has anyone done this?
I am open to any and all suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi and welcome to the ThinApp forums...
To my opinion you are taking a slightly to complex approach on the problem.
A simpler solution would be having a simple entry point that takes your options (local/nw, path, formname) as parameters and launches the process itself. This way you would not have to store the settings nor 'alter' the default entry point.
It is always nice if an entry point is OK, but if there are dynamic properties, keep them dynamic. I'm not sure if you have some programmer resources as the issue you describe would be something to be completed on a spare afternoon. As the 'commandline' option is used parameters passed on the commandline are not forwarded to the application. If you leave out this parameter, you could just pass the given options and process them in the application. This of course can also be realised in some VB script or similar...
Sorry i don't have a ready-fit solution for you...
Kind regards,
Michael Baars - Comprehensive ICT Solutions (NL)
(Please remember to mark the post answered if so and reward points to helpfull answers...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Having a simpler solution would be wonderful. Are there any examples of how to create an entry point that can accept runtime parameters?
[EDIT]
Have learned that entry point exe's can handle parameters just like standard exe's. That was not initially clear from any of the ThinApp documentation. I am working on a much simpler solution that incorporates that and forgoing a script to create a file during the startup but instead using a file on the physical drive. For now I am creating the folder structure and file manually but if anyone has any idea how to possibly create the phyisical folder during the MSI installation, that might be nice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.