
Best Answer Berto , 29 September 2015 - 15:07
Hi, this is very helpful. I was not aware of the existence of the "QueryProgItem" function ... this way i can make the implementation a lot easier. Great tip! Thx again
I can have function "FindAllFiles" look for the "*.lnk" files on the desktop and AllPrograms folder and use QueryProgItem to compare the command line with the exe name of my application to find a match.
In the meantime I managed to get my own implementation working. I'll just briefly explain the solution if anyone would be interested:
Using InstallScript I wanted to apply a transform (.MST file) to a copy of my cached MSI file so i could read the localized names of the shortcuts from the MSI's Shortcut table
The problem was that function "MsiDatabaseApplyTransform" did not seem to be working. According to the MSDN installer doc, it can not be used in a custom action.
It says "This function cannot be called from custom actions. A call to this function from a custom action causes the function to fail."
However using the Windows Installer COM object seems to be working, so I implement something like this:
That seems to work fine. Next, use functions like MsiOpenDatabase, MsiDatabaseOpenView, MsiViewExecute, MsiViewFetch & MsiRecordGetString to read the table you want from the transformed MSI.
Krgds
Berto
Go to the full post