Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] User Tips, Tricks and Samples
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Rating: Thread Rating: 2 votes, 3.00 average. Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 04-28-2010, 02:00 PM
HippyCraig HippyCraig is offline
Registered User
 
Join Date: 07-27-2006
Location: Philly
Posts: 211
Thanks I was able to get it to work. Just to explain what I was doing see code snipit below. This seems to work but if there is better way I am open to sugestions.



Option Explicit

Dim objApp, objStep, objStepToMod, iCurrentIndexID, strSetupProject, arrParameters, arrParamValues, iCount
Dim strProjectFile, strComments, strInstallAllUsers, strProductName, strTitle, strManufacturer, strAuthor, strReleseMSIName, strVirtualDir

Set objApp = CreateObject("VisBuildSvr7.Application")
objApp.Project.Load "%PROCFILES_FULLPATH%"

'Set Find Step
For Each objStep in objApp.Project.Steps(vbldStepMain)
If objStep.Property("SubName") = "SUB Modify Setup Project" Then
iCurrentIndexID = objStep.Index

arrParameters = objStep.Property("Parameters")
arrParamValues = objStep.Property("ParamValues")

'Read in Values
For iCount = 0 to UBound(arrParameters)
If arrParameters(iCount) = "TMP_PROJECT_FILE" Then strProjectFile = arrParamValues(iCount)
If arrParameters(iCount) = "TMP_COMMENTS" Then strComments = arrParamValues(iCount)
If arrParameters(iCount) = "TMP_INSTALL_ALL_USERS" Then strInstallAllUsers = arrParamValues(iCount)
If arrParameters(iCount) = "TMP_PRODUCT_NAME" Then strProductName = arrParamValues(iCount)
If arrParameters(iCount) = "TMP_TITLE" Then strTitle = arrParamValues(iCount)
If arrParameters(iCount) = "TMP_MANUFACTURER" Then strManufacturer = arrParamValues(iCount)
If arrParameters(iCount) = "TMP_AUTHOR" Then strAuthor = arrParamValues(iCount)
If arrParameters(iCount) = "TMP_RELEASE_MSI_NAME" Then strReleseMSIName = arrParamValues(iCount)
Next

'Find Virtual Directory
'This code would open a file found in one of the properties and find a Virtual Directory in the setup and populate
'populate that new value in the sub call
'strSetupProject = vbld_GetFileContents(objApp.ExpandMacros(strProjec tFile))

'Reasign Values
objStep.Property("Parameters") = Array("TMP_PROJECT_FILE", "TMP_COMMENTS", "TMP_INSTALL_ALL_USERS", "TMP_PRODUCT_NAME", "TMP_TITLE", "TMP_MANUFACTURER", "TMP_AUTHOR", "TMP_RELEASE_MSI_NAME", "TMP_VIRTUAL_DIR")
objStep.Property("ParamValues") = Array(strProjectFile, strComments, strInstallAllUsers, strProductName, strTitle, strManufacturer, strAuthor, strReleseMSIName, strVirtualDir)

End If
Next


Builder.LogMessage("Added New Virtual Directory '" & strVirtualDir & "' to Sub Call")
objApp.Project.Save
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 09:26 AM.


Copyright © 1999-2023 Kinook Software, Inc.