PDA

View Full Version : how to bundle an executable in the installer and then call it before the installation



charlescao
07-19-2004, 02:05 PM
I want to bundle a license check executable into my installer, then I can call it after user input the license key. But this action happens before install action. So I have two questions on how to realize it.

1) How can I add the license checker executable during the build time?

2) How can I find and call or launch the executable during the runtime?

Thanks1

chirags
07-19-2004, 02:52 PM
Please refer to the following Knowledge Base Article which explains how to include a file into setup archive during build time and retrive the file during run time.

http://support.installshield.com/kb/view.asp?articleid=Q105545

Hope this helps.

Cheers,
Chirag

charlescao
07-20-2004, 01:42 PM
Thanks for the information. I did as the document told me. But I kept getting the exception.

java.io.IOException: entry e106132408b971340a2684059356f7c3/cypher.exe does not
exist in F:\My InstallShield X Projects\Installer\distribution\d
isk1\setup.jar

It seems that the resource is not included in the archive. But I am sure that I specify the correct resource with the absolute path. and specify the ResourceName while I am trying to get the resource. And I don't know how can I debug this kind of issue.

Any suggestion?

whivey
09-23-2004, 02:50 PM
I add my runtime setup files to the archive via the direct editor's
SETUP_FILE page. Then, to access them during an install event, I
created this method:


/**
* Get a setup file from the archive and make it available to the
* install.
*
* @param fileName setup file name as found in archive
* @param tofileName new name for setup file, or null to use fileName
* @param context ISContext reference.
* @return file name with path if successful, null otherwise.
*/
private String fetchSetupFile( String fileName, String toFileName, ISContext context ) {
if ( toFileName == null || toFileName.length() == 0 ) toFileName = fileName;
try {
URL url = context.getServices().getResource( fileName );
return new FileUtils().createTempFile( url, toFileName );
} catch ( IOException e ) {
LogUtils.getLog().logEvent(this, Log.ERROR, e);
}
return null;
}
The fileName argument is the actual name of the file, not the tag
that some other methods require. It's just the name, not the path,
but I'm pretty sure it's case-sensitive although I haven't tested
that. -Wm