I'll try to explain my package. This may be more info than necessary, but someone might find it useful. The point of the package is to call a batch file that executes gpg to decrypt a file. This is the batch file gpg.bat which is in a directory in my path.@echo offgpg --passphrase-fd 0 <%1 -o %2 -d %3
The parms are %1 is a file containing the passphrase. %2 is the name of the decrypted file. %3 is the encrypted file.Now for the package:Step 1: asxCreatePassordFile - I create the passphrase file on the fly so it's not laying around on the server:Function Main() Const fsoForWriting = 2 Dim objFSO Dim objTextStream Dim theFile Set objFSO = createobject("Scripting.FileSystemObject") Randomize theFile = DTSGlobalVariables("passwordFilePath").Value + "\" + CStr( Int((99999999 * Rnd) + 10000001) ) + ".txt" DTSGlobalVariables("thePasswordFile").Value = theFile Set objTextStream = objFSO.OpenTextFile(theFile, fsoForWriting, True) 'Write the passphrase objTextStream.WriteLine "ldfjasldf" 'Close the file and clean up objTextStream.Close Set objTextStream = Nothing Set objFSO = Nothing Main = DTSTaskExecResult_SuccessEnd Function
Step 2: axsBuildGPGCommandFunction Main() DTSGlobalVariables("pgpCommand").Value = "gpg.bat " + DTSGlobalVariables("thePasswordFile").Value + " " + _ DTSGlobalVariables("outFile").Value + " " + _ DTSGlobalVariables("gpgFile").Value Main = DTSTaskExecResult_SuccessEnd Function
Step 3: setGPGCommand - This is a Dynamic properties task with:- Destination Property = ProcessCommandLine
- Source Type = Global Variable
- Soure Value = gpgCommand 'gpgCommand is a globalvar set in step 2
Step 4: exeGPG - This is the Execute Process Task that should be set by Step 3.