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 = "File_name"
stem.pszVariableDescription.3 = "The file name for the generated files, for example, CPPDLL."
stem.pszVariableValue.3 = "cppdll"
stem.pszVariableName.4 = "Export_Method"
stem.pszVariableDescription.4 = "Specify the export method you want use:\n1 to export by ordinal \n2 to export by assigned name and ordinal \n3 to export by mangled name"
stem.pszVariableValue.4 = "2";
stem.pszVariableName.5 = "Runtime_library"
stem.pszVariableDescription.5 = "Specify the runtime libraries you want to use:\n1 for single-threaded \n2 for multi-threaded"
stem.pszVariableValue.5 = "1";
stem.pszVariableName.6 = "Custom_Init_Term"
stem.pszVariableDescription.6 = "Specify whether you want to provide your own custom initialization and termination entry point for the DLL:\n1 to use the default \n2 for custom (a template source file is created for you)"
stem.pszVariableValue.6 = "1";
stem.pszVariableName.7 = "Prolog"
stem.pszVariableDescription.7 = "The prolog that appears at the head of all the generated source files."
stem.pszVariableValue.7 = "/* \n * This file was created for %YOUR_NAME% \n * by Project Smarts on %DATE%. \n */";
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 = 'VAPSCPDLL';
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()
/* Display 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.");
call CheckVars;
end
/* Save variable settings */
rc = IwfSaveVariables(stem);
if (rc <> RC_OK) then SAY ("Error saving variable settings.");
/* Strip any backslashes from the end of the specified target path */
/* 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"."
/* Copy the general files */
stem.pszSourceFileMask = Src;
rc = IwfCopyWithSubstitution(stem);
if (rc <> RC_OK) then call Abort("Error performing copy with substitution.");
/* Copy method-specific files */
if (Method = '1') then stem.pszSourceFileMask = Src'\EXPORT'
if (Method = '2') then stem.pszSourceFileMask = Src'\PRAGMA'
if (Method = '3') then stem.pszSourceFileMask = Src'\CPPFILT'
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 'cppdll.* 'stem.pszVariableValue.3'.*'
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.");
/* Delete INITTERM.C if not required */
if (InitTerm <> "2") then
del 'initterm.c'
/* Restore current directory */
call DIRECTORY curdir;
/* Create the WorkFrame project */
stem.usPercent = 90;
stem.pszStatusText = "Creating the Workframe/2 project.";
rc = IwfUpdateConsoleProgress(stem);
rc = IwfUpdateConsoleStatus(stem);
SAY "The project will be created in "stem.pszTargetFolder;
/* 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.");
ShellPath = ShellPath'\smarts\projects';
if (Library="1") then
DO
if (Method="3") then stem.pszSourceProject = ShellPath'\CDLL_SDF'
else stem.pszSourceProject = ShellPath'\CDLL_SD'
END
if (Library="2") then
DO
if (Method="3") then stem.pszSourceProject = ShellPath'\CDLL_MDF'
else stem.pszSourceProject = ShellPath'\CDLL_MD'
END
SAY "Shell project: "stem.pszSourceProject;
/* If CPPFILT method, must rename def file to BASICDEF */