PDA

View Full Version : Registering DLL



Ajay Verma
12-01-2005, 07:44 AM
Hi All

I am having a DLL to register. Problem is that if the previous version of this dll is already there in some folder on the destination computer then I have to deploy the new dll in the same path and register it.

But if the dll is not there then I have to deploy it in the SYSTEM32 Folder of the Destination computer and have to register it.

I knw that I can get the path of the dll if it is already present on the destination computer through SYSTEM SEARCH Option. But what if dll is not there.

I want to achieve this in BASIC MSI PROJECT.

Thanks and Regards
Ajay Verma

DMorisseau
12-01-2005, 09:20 AM
Ajay, if the system search fails, the property that you designate for it will be empty. What you will need to do is create a custom action that uses MsiGetProperty to retrieve the value of the property you identified when you created the System Search. If the property value is empty, set the target path for that component to SystemFolder; otherwise set the target path to the value MsiGetProperty returned.

You may need to run ParsePath on the returned value to strip off the file name.

Ajay Verma
12-01-2005, 11:17 PM
Hi...Thanks for the Quick Response....

U have written that "If the property value is empty, set the target path for that component to SystemFolder; otherwise set the target path to the value MsiGetProperty returned."

how to achieve the following in BASIC MSI....Pls let me know

Ajay

srikapat
12-02-2005, 12:17 AM
hi

to achieve this, u need to go System Search view and add a search on the dll that u want. as soon as u do this, if the dll is found on the destination computer then the value of the path to dll is assigned to the Property variable that u have created under system search view.

you can then use this property in ur own custom action using MsiGetProperty . This function will return the value of the property( which basically would be the path to the dll in ur case).

Suppose, if the dll is not found, then the Property variable that u have created in the System Search view would be null.

hope this helps.

Srika