Our implementation team want a method of identifying a particular installation, so they can quickly establish which installation a particular machine has (we have several installer builds that, once installed, all look the same to the users, and all run the same software).
I thought that putting a file in the application directory, with the installer build number, date and time as its name, would do the job - but I can't find a way to do this. I can't even get the [|Date] or [|Time] properties to display in the installer comments field (which uses the [|ProductName] and [|ProductVersion] properties without a problem).
I can obviously create a file by hand with an installer build number, date and time as its name, but I'd then have to edit the build's Files & Folders to include it every time I do a build...
Is there some way to automatically provide a clear indication of the installer build that was used for a particular installation?
Nonetheless, your installer's Package Code is enough to identify a particular installation of your product. You can use the [PackageCode] property to store it in a file or registry during install, then check for it when needed.
GabrielBarbu wrote:Nonetheless, your installer's Package Code is enough to identify a particular installation of your product. You can use the [PackageCode] property to store it in a file or registry during install, then check for it when needed.
OK, that sounds like what I need - how would I store it in a file during install ?
You can use either an .INI or an .XML file to store this, as these have direct support in Windows Installer. However if you need to store it in another format, you will have to use your own Custom Action.
I now have my application install working as required, having tried creating an 'Install Details' file with a Custom Action, an XML file, and an INI file, to hold the installation PackageCode and Date & Time.
Just For Your Information
You might be interested to know that all three file creation options above worked flawlessly when installing the application to the local drive (C:), but only the INI file option worked when installing the application to a network drive.
The VB Script in the Custom Action was unable to locate the file it was supposed to write into (although it was present) on the network drive - it was OK on a local drive.
When the installer tried to create & write to the XML file on a network drive, it displayed the message box: "Error opening file: N:\Program Files\...\Install Details.xml". It also was OK on a local drive.
The network drive used for testing had full access permissions, and the same failures occurred when using a mapped drive pointing to a directory on the local drive. All the other application files including the custom INI file were copied and initialised as expected.
Here is the relevant log extract for the XML file failure on mapped drive N:
MSI (s) (D4:84) [14:46:45:532]: Executing op: ActionStart(Name=AI_XmlRollback,Description=Rolling back XML file configurations.,Template=Rolling back XML file configurations.)
Action 14:46:45: AI_XmlRollback. Rolling back XML file configurations.
MSI (s) (D4:84) [14:46:45:610]: Executing op: CustomActionSchedule(Action=AI_XmlRollback,ActionType=11521,Source=BinaryData,Target=**********,CustomActionData=**********)
MSI (s) (D4:84) [14:46:45:642]: Executing op: ActionStart(Name=AI_XmlConfig,Description=Executing XML file configurations,Template=Configuring XML file: "[1]")
Action 14:46:45: AI_XmlConfig. Executing XML file configurations
MSI (s) (D4:84) [14:46:45:704]: Executing op: CustomActionSchedule(Action=AI_XmlConfig,ActionType=11265,Source=BinaryData,Target=**********,CustomActionData=**********)
MSI (s) (D4:B0) [14:46:45:814]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI659.tmp, Entrypoint: OnXmlConfig
MSI (s) (D4:60) [14:46:45:860]: Generating random cookie.
MSI (s) (D4:60) [14:46:45:907]: Created Custom Action Server with PID 4068 (0xFE4).
MSI (s) (D4:C0) [14:46:46:001]: Running as a service.
MSI (s) (D4:C0) [14:46:46:032]: Hello, I'm your 32bit Elevated custom action server.
AI_XmlConfig: Configuring XML file: "N:\Program Files\Company\MyProduct\Install Details.xml"
Error 4115. Error opening file: N:\Program Files\Company\MyProduct\Install Details.xml.
MSI (s) (D4!80) [15:13:56:136]: Product: MyProduct -- Error 4115. Error opening file: N:\Program Files\Company\MyProduct\Install Details.xml.
Action ended 15:13:56: InstallExecute. Return value 3.
MSI (s) (D4:84) [15:13:56:215]: User policy value 'DisableRollback' is 0
MSI (s) (D4:84) [15:13:56:261]: Machine policy value 'DisableRollback' is 0
MSI (s) (D4:84) [15:13:56:293]: Executing op: Header(Signature=1397708873,Version=301,Timestamp=991130963,LangId=1033,Platform=0,ScriptType=2,ScriptMajorVersion=21,ScriptMinorVersion=4,ScriptAttributes=1)
MSI (s) (D4:84) [15:13:56:324]: Executing op: DialogInfo(Type=0,Argument=1033)
MSI (s) (D4:84) [15:13:56:355]: Executing op: DialogInfo(Type=1,Argument=BondEye)
MSI (s) (D4:84) [15:13:56:402]: Executing op: RollbackInfo(,RollbackAction=Rollback,RollbackDescription=Rolling back action:,,CleanupAction=RollbackCleanup,CleanupDescription=Removing backup files,CleanupTemplate=File: [1])
Action 15:13:56: Rollback. Rolling back action:
1: Executing XML file configurations
That log was taken from an install onto a drive-mapped directory on the local C: drive that I created - I have administrator rights and gave the directory and the mapped drive full read/write permissions - if there are other permission requirements, I am unaware of them (the OS was Windows XP).
The only difference in the install was the substitution of drive letter C: for drive letter N: The custom INI file containing the same information was created on drive N: and written to without any problem. The XML file failure log looks very similar to the failure when creating a text file on the network drive using a Custom Action - with the Custom Action, I had the empty file copied from the install to the application directory, then used the suggested VB Script to write the data into it. The VB Script failed to locate the file on the network drive. However, exactly the same Custom Action and script worked fine when installing to the local C: drive.
I have tried writing all three file types, INI, XML, and Custom Action text file on local drive, network drives and drive-mapped local directories. They all work fine on the local drive, but only the INI file creation/writing works on network drives and drive-mapped directories. I don't know why.
It isn't a problem for me, as the INI file works and is sufficient for my requirements. I don't have a solution for the failures - I just thought it would be useful for Caphyon to know that certain installer file operations can be problematic on network drives.
Please note that if your install is per machine, the XML install will be run under the local SYSTEM account, which might not have access permissions on your network. You will need to add permissions for the SYSTEM account on your network.
Another solution is to open the .aip project file with a text editor and find these rows in your .aip
You might be interested to know that I had no joy changing permissions for the SYSTEM account - whatever I tried, the XML file creation still failed... But when I edited the .aip file Type attributes as you suggested, it worked
I know this is a really old post but Gabriel's suggestion has actually fixed two issues of mine. The first one was exactly the same as OP, trying to modify an xml file installed on a network drive. My second issue was during the AI_IISConfig action. I was getting the following error:
AI_IIsConfig: Installing "Default Web Site/Private"
COM Error : (Access is denied.) Could not get Admin Section 'system.web/identity', with entry path 'MACHINE/WEBROOT/APPHOST/Default Web Site/Private'.
Received NULL element as input parameter, aborting..
COM Error : (Unknown error 0xFFFFFFFF) Cannot set property. Aborting..
COM Error : (Unknown error 0xFFFFFFFF) Could not set ASP properties for 'Default Web Site/Private'.
COM Error : (Unknown error 0xFFFFFFFF) Could not set common entity properties.
COM Error : (Unknown error 0xFFFFFFFF) Could not create WebApp/VDir, isWebApp = true
I noticed that the Action's type was the same as the original one for AI_XmlConfig so I set it to 1025 and it fixed my issue.
I like to know a little more about fixes and my boss doesn't accept "It's magic!" as a fix reason... so what does this do? Since this was a right's issue I'm guessing this changes the user that performs the action?
Yes, you are right. Instead of executing under the LocalSystem account, the related custom actions (using the "1025" type) will be executed under current installing user.
FOLLOW US
Get the latest news in Application Packaging