CustomAction - File key too long for Source fieldWe recently created a MSI package using the Visual Studio Installer V1.1 for a Visual Basic application. We had the requirement of launching an executable during the installation process and therefore had to manually modify the MSI package using Orca. The most common method for launching an executable during installation is to add a custom action to the CustomAction table of the MSI package. It is normally recommended to use Custom Action 18 to run a file which was included with the installation package, however when you attempt to do this, if the file key is longer than 64 characters, you get the error "Could not change this cell to 'xxx' because the string is too long for the cell.". The max length for a file key is 72 characters, but the max length for the "Source" field is 64 characters, which doesn't make any sense. To get around this issue, it is possible to run an exe file using Custom Action 14. With custom action you must specify TARGETDIR (or other directory) as the "Source" field, any name you choose as the "Action" field, 34 as the "Type" field, and the executable full path as the "Target" field. To make sure this value remains dynamic, it is possible to specify this value as [#filekey], where filekey is the file key in the File table of the file you want to execute. So for example, it may be [#PO1_71F30A325ECC424F9F8E9B8394A38AF1_E06805FE2375405FAD48F55EEBE45445]. You can then launch this CustomAction the same way as you normally would. I put an entry in the InstallExecuteSequence table at the very end using the name of the CustomAction in the "Action" field, "NOT Installed" in the "Condition" field and a sequence number larger than all the rest. The executable should now launch without any problems. Author: DPAK Created: Feb 12 2006 Categories: Development TechByte #123 Warning: By visiting this site and/or by using any information contained herein, you agree to the Techbytes.ca terms of use. Add a comment about this TechByteIf you wish to add a comment regarding this TechByte, please use the form below. Please note that by submitting comments using this form you are allowing all of the information submitted to be visible on this website. Any comments submitted using this form will only be shown on the website if they are approved by the administrators of this site. IF APPROVED, COMMENTS MAY TAKE SEVERAL DAYS TO BE POSTED. Other TechBytes: |
|

