stem.pszVariableDescription.1 = "Your name for the source file prolog."
stem.pszVariableValue.1 = "Your name"
stem.pszVariableName.2 = "Date"
stem.pszVariableDescription.2 = "The date for the source file prolog."
stem.pszVariableValue.2 = Date()
stem.pszVariableName.3 = "Title"
stem.pszVariableDescription.3 = "The title of the Information document you want to create. This title will appear in the title bar of the Information window."
stem.pszVariableValue.3 = "Information on an Application"
stem.pszVariableName.4 = "File_name"
stem.pszVariableDescription.4 = "The file name for the generated files, for example, DOCUMENT."
stem.pszVariableValue.4 = "document"
stem.pszVariableName.5 = "Prolog"
stem.pszVariableDescription.5 = "The prolog that appears at the head of all the generated source files."
stem.pszVariableValue.5 = ".* %TITLE%. This file was created for %YOUR_NAME% \n.* by Project Smarts on %DATE%. ";
rc = IwfUpdateConsoleProgress(stem);
rc = IwfUpdateConsoleStatus(stem);
SAY "Confirm the settings of variables used to customize the installation."
/* Restore any saved variable settings */
stem.pszCatalog = Cat;
stem.pszApplication = 'VAPSINF';
rc = IwfRestoreVariables(stem);
if (rc <> RC_OK) then SAY ("Could not restore variable settings. Will use defaults.");
/* Restore date to current date */
stem.pszVariableValue.2 = Date()
/* Show Variable Settings window */
do until (rc = RC_OK)
rc = IwfQueryVariables(stem);
if (rc = RC_CANCEL) then call Cancel
else
if (rc <> RC_OK) then call Abort("Error querying variable settings.");
end
/* Save variable settings */
rc = IwfSaveVariables(stem);
if (rc <> RC_OK) then SAY ("Error saving variable settings.");
/* Copy the files over, substituting the variable settings. */
stem.usPercent = 50
stem.pszStatusText = "Copying files, with substitution."
rc = IwfUpdateConsoleProgress(stem);
rc = IwfUpdateConsoleStatus(stem);
SAY "The project source files in" Src "are being copied to" stem.pszTargetDirectory"."
stem.pszSourceFileMask = Src;
rc = IwfCopyWithSubstitution(stem);
if (rc <> RC_OK) then call Abort("Error performing copy with substitution.");
/* Renaming files */
stem.usPercent = 60
stem.pszStatusText = "Renaming files."
rc = IwfUpdateConsoleProgress(stem);
rc = IwfUpdateConsoleStatus(stem);
curdir = DIRECTORY();
newdir = DIRECTORY(stem.pszTargetDirectory);
rename 'document.* 'stem.pszVariableValue.4'.*'
if (rc <> RC_OK) then call Abort("Error renaming files. The specified file name may be invalid or the disk is full. Please delete any created files and start over.");
call DIRECTORY curdir;
/* Create and set the WorkFrame project setup. */
stem.usPercent = 80;
stem.pszStatusText = "Creating the Workframe/2 project.";
rc = IwfUpdateConsoleProgress(stem);
rc = IwfUpdateConsoleStatus(stem);
SAY "The project will be created in "||stem.pszTargetFolder;
pszTarDir = stem.pszTargetDirectory;
/* Get the path of the shell projects */
ShellPath = VALUE('CPPMAIN',,env); /* on CPPMAIN variable path */
if ShellPath='' then call Abort("Error obtaining Project Smarts path.");