export folder automatic creation

KenM

KenM

Active Member
I finally got tired of having to create export and import folders on each client workstation after a fresh install, and seeing as this client has an AS/400 (iSeries) enterprise server, I did something about it.

This may not be the best method, but since I only had an hour or two to work on it, it'll hold for now. I'll go back and re-address it when I come back in a month or so. It only works on scheduled packages, not packages installed using "Add/Remove Programs" or running the setup.exe program directly. I'll update this post when I have more time and can redefine this task to work for all deployments.

I created a C++ business function with one line in it.
jdeGetPrivateProfileString("INSTALL", CURRENT_RELEASE_LEVEL, "",
lpDS->szInstallPath, MAX_PATH);

Then added table event rules to F98825's "Before Record is Updated"

Listing of ER for Table ER: F98825

=======================================================================
TABLE: Package Deployment Scheduling
=======================================================================
EVENT: Before Record is Updated
-----------------------------------------------------------------------
evt_DRPT_szDirPathFromJDEINI
evt_DRPT_szExportDirPath
evt_DRPT_szImportDirPath
evt_USAGE_szMachineUsage
evt_PORTNUM_mnPortNumber
0001 //
0002 // Ken Mauldin - 2006-06-22 - Create Export and Import folders after
0003 // installing a package to a client
0004 //
0005 If TK InstallPackageStatus is equal to "30,50"
0006 // Check to see if this is a server or client
0007 VA evt_PORTNUM_mnPortNumber = "0"
0008 VA evt_USAGE_szMachineUsage = "10"
0009 F9650.Fetch Single
TK Machine Key = TK Machine Key
VA evt_PORTNUM_mnPortNumber = TK Port Number
VA evt_USAGE_szMachineUsage = TK Machine Usage
0010 If SV File_IO_Status is equal to CO SUCCESS
0011 // It's a client. Get the C:\B7 or equivalent from the JDE.INI
0012 CCWA Get Install Directory from JDE.INI
VA evt_DRPT_szDirPathFromJDEINI <- szInstallPath
0013 // Concatenate the pathcode and "export" or "import"
0014 VA evt_DRPT_szExportDirPath = concat(concat(concat([VA evt_DRPT_szDirPathFromJDEINI],"\\"),rtrim([TK CodePath],' ')),"\\export")
0015 VA evt_DRPT_szImportDirPath = concat(concat(concat([VA evt_DRPT_szDirPathFromJDEINI],"\\"),rtrim([TK CodePath],' ')),"\\import")
0016 // Create the new directories - if they already exist, this function will not
0017 // error; it'll just keep right on going.
0018 CreateDirectoryPath
VA evt_DRPT_szExportDirPath -> szDirectory
0019 CreateDirectoryPath
VA evt_DRPT_szImportDirPath -> szDirectory
0020 End If
0021 End If
0022 //

Thursday June 22, 2006 13:49
 
Back
Top