I ran across a well written article on creating an MSDE msi embedded
installation but it seems to be missing a critical step. The purpose of an
embedded installation should be based on a condition (exmple
\Software\Microsoft\Microsoft Sql Server\Instancename). If the condition
exists, there would be no need to call the embedded installation. The above
example would be a Registry Target that I would name "MSDEInstalled". If
the registry item did not exist the installer should know how to call the
embedded msi to install MSDE.
I am confused as to whether this Custom Action would be a Type 39 or a Type
50. I made a guess that it is a type 39, but the code I have put in to
create the condition and then based on the condition - to call or not call
the embedded MSDE installation - is not clear to me.
Here is my best approximation. If someone can help a bit I would appreciate
it. If you look closely you'll see I am rather lost on this Custom Action
property.
--
Regards,
Jamie
Assume that I have defined a registry key and called it MSDEInstalled which
is the key for my instance:
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MyInstance. Also assume that I
am defining this as a type 39 Custom Action.
InstallMSDE.vbs
Option Expicit
dim inst, rec, sqlquery, database, view
sqlquery="SELECT 'MSDEInstalled' FROM _Storages"
set inst=Createobject("WindowsInstaller.Installer")
"" lookup path to parent MSI
set database=inst.OpenDatabase("<path to Parent MSI>",1)
set view=database.openview(sqlQuery)
set rec=inst.createrecord(2)
rec.stringdata(1)="MSDEInstalled"
view.execute rec
If rec.value then
UINT MsiDoAction (MSIHANDLE hInstall, LPCTSTR szAction)
""next line would set the condition true so that the calling routine can
continue