i want to install an upgraded version of an application but when i am installing it on the client machine i want to write acustom action which close the application before installation so could you please help me in this
Thanks in advance

Posted 22 January 2004 - 18:10
Posted 22 January 2004 - 19:47
CODE |
/////////////////////////////////////////////////////////////////////////////// // // Function: IsInUse // // Purpose: Checks for running app ////////////////////////////////////////////////////////////////////////////// function MM_IsInUse ( hMSI ) STRING szFolder, szRegFolder; NUMBER nIsLocked, nvType, nvSize; begin // Assume default installation folder (if no reg key found) szFolder = PROGRAMFILES ^ "Company\\Product"; szRegFolder = "Software\\Company\\Product\\Version\\Installer"; // Work in the HKLM section of the registry RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE ); // Read the installation folder from the registry RegDBGetKeyValueEx ( szRegFolder, "MainDir", nvType, szFolder, nvSize ); // Check if TheEXE.exe exists in the MainDir folder nIsLocked = Is ( FILE_LOCKED, szFolder ^ "TheEXE.exe" ); if (nIsLocked = 1) then SetDialogTitle ( DLG_MSG_SEVERE, @Warning_Generic ); MessageBox ( @Error_EXEInUse, SEVERE ); try abort; Err.Clear; catch SetDialogTitle ( DLG_MSG_SEVERE, @Error_Generic ); MessageBox (@Error_AbortError, SEVERE); Err.Clear(); endcatch; else // endif; end; |