Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

patch


7 replies to this topic

sumita

sumita
  • Members
  • 18 posts

Posted 25 May 2004 - 10:01

I Need to know how to write patch script for installsheild . has anyone tried it?? Is it a good thing to do to fix the bugs??

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 25 May 2004 - 11:51

Patching can be a complicated process depending on how the previous version of your product was deployed. However, it is difficult to say anything without knowing what Installshield product you are using or if you are using windows installer at all (or regular installscript or similar)?
Regards
-Stein Åsmul

sumita

sumita
  • Members
  • 18 posts

Posted 25 May 2004 - 12:03

Am using InstallShield Professional 6.3 .And i need to use patch as there might be some bugs in future which iwant to rectify wihtout uninstalling as the application might be too large .and uninstalling and then changing a small dll and then reinstalling would be too complicated !!so how do i use patch??

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 25 May 2004 - 12:07

Sorry, I got lost into a forum where I don't belong smile.gif. This is a case for the taco-meister I think (Taco Bell).
Regards
-Stein Åsmul

sumita

sumita
  • Members
  • 18 posts

Posted 25 May 2004 - 12:12

Taco Bell please need ur help !! somebody help me!!


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 25 May 2004 - 15:12

Unfortunately, patching is not built-in concept for 6.3 like it is for later versions of the product. Nevertheless, patching is still possible with this version of IS. It just takes more work on your part.

For example, over the years, I have tailored my IS projects to have four different installation scenarios--all in one set of code: full install, update install, service pack install, & patch install. I have a H file that initializes the required variables to depict the necessary setup type, and then I have conditionalized my remaining code in such a way that it can react accdordingly (e.g. title bars, dialogs for the setup wizard, cleanup, uninstallation support, etc.).

I doubt you want to go that extreme though for this initial pass, but I just wanted to give you an idea what is posssible.

Now back to your specific case though. Patching a file or subset of your files isn't too bad. Basically, you would need to do the following steps:
  • Take your existing InstallShield project and make a copy of it. Renaming the included ._ip & .ipr files appropriately (e.g. Product._ip --> ProductPatch._ip).
  • Strip out the unneeded data files for the file groups. In other words, all the files you won't be patching.
  • Replace these data files with their patched counterparts.
  • Open the IS project and open the Project | Properties to assign it a new GUID.
  • Add/modify the InstallScript to detect the previous installation directory and the enforce the required version of the software (e.g. this patch will work on v1.1, but not v1.0).
  • Tailor the OnFirstUIBefore event code to display the appropriate dialogs for the setup wizard. For example, maybe just a welcome screen, a description of the patch, and then a summary of the detected settings before installing the files.
  • Modify the OnFirstUIAfter event code to delete this setup's uninstall entry in HKEY_LOCAL_MACHINE in order to prevent Maintenance mode and to defer uninstallation support to the real product install.
Hope it helps and good luck.


user posted image

Ozone

Ozone
  • Full Members
  • 77 posts

Posted 26 May 2004 - 20:15

The need to add a ‘Patches’ routine became necessary for us about three years ago. We would compile our project and compile the install CD. One or more months down the line a bug or new feature needed to be ‘patched’ into this system. A newer version would not be made for some time. We did not want to re-compile a new CD so I figured out how to ‘add’ files to the next CD that we burned. (Note: that we do not mass produce CD’s from the master, we make them to order.)

We added a subfolder named \Patches to the CD and included all the files that we needed to patch. These files are uncompressed. The folder \Patches corresponds to the TAREGETDIR, so if you have files that need to go into subfolders, you need to duplicate the subfolders with the correct names. Example: \Patches\Data would be for TARGETDIR ^ "\\Data"

I wrote a function named Patches() and call it after the normal media is installed. (The OnMoved() event). The Patches() function only works if the installing CD has a folder named \Patches on it. We do not patch customer data files or any files that are NEVEROVERWRITE!

You will have to remark out some other functions in the script below.

Find_All_Files_CANCEL();
READ_ONLY_OFF();
Time();
LOG_File_Create();

Variables that are used in the function, but not defined in the function are global in my script and you need to add them when applicable.

CODE

///////////////////////////////////////////////////////////////////////
//
// FUNCTION:   Patches()
//
// Purpose: To install patches issued by Support Dept.
//
//  Information: If a subfolder exists on the installation CD named
//               \Patches , then this routine copies these patch files
//               into the XXXX system
//               The source folder is in
//     F:\Everyone\Support\Patches\'date'                                            
//
//
// Added:  05-24-2001  TEB
//
///////////////////////////////////////////////////////////////////////

function Patches()

NUMBER  nvAnswer, nCopy_Error, nzResult, nvResult;
STRING  svFile, svResult, svFile_Date, svFile_Time, svFile_Only;

begin


VarSave ( SRCTARGETDIR );
     
nvAnswer = Is ( PATH_EXISTS , SRCDIR ^ "\\Patches" );

if nvAnswer = TRUE then

Time();
LOG_File_Create();
WriteLine ( nvLOG_FileHandle , "Patches install started ========== Date: " + svDATE + "   Time: " + svTIME );
CloseFile ( nvLOG_FileHandle );

   // setup default status window
Enable(STATUSEX);
Enable(INDVFILESTATUS);
SetStatusWindow(0, "Installing Patches");
StatusUpdate(ON, 100);

SRCDIR = SRCDIR ^ "\\Patches\\";

nCopy_Error = XCopyFile ( "*" , "" , COMP_NORMAL | INCLUDE_SUBDIR );

Disable(INDVFILESTATUS);
Disable(STATUSEX);

 if nCopy_Error = 0 then
  // list files patched in logfile
     nzResult = FindAllFiles( SRCDIR  , "*.*" , svFile , RESET );
     while nzResult = 0
      GetFileInfo ( svFile, FILE_DATE, nvResult, svFile_Date );
         GetFileInfo ( svFile, FILE_TIME, nvResult, svFile_Time );
         ParsePath ( svFile_Only, svFile, FILENAME );
         LOG_File_Create();
         WriteLine ( nvLOG_FileHandle , "Patch file name is: " + svFile_Only + " == Dated: " + svFile_Date + "  Time: " + svFile_Time );
   CloseFile ( nvLOG_FileHandle );
         nzResult = FindAllFiles( SRCDIR  , "*.*" , svFile , CONTINUE );
     endwhile;
     
     // Clear buffer
     Find_All_Files_CANCEL();
       
     // Reset each patched file attribute to Archive only!
     SdShowMsg ("Removing Read-Only attribute from Patched files .... Please wait, this may take some time.....",TRUE);
     READ_ONLY_OFF();
     SdShowMsg ("",FALSE);
     
     Time();
  LOG_File_Create();
  WriteLine ( nvLOG_FileHandle , "Patches install Finished ========= Date: " + svDATE + "   Time: " + svTIME );
  CloseFile ( nvLOG_FileHandle );
                 
    elseif nCopy_Error < 0 then // Error installing pathces
     Time();
  LOG_File_Create();
  WriteLine ( nvLOG_FileHandle , "Error installing Patches ========= Date: " + svDATE + "   Time: " + svTIME );
  CloseFile ( nvLOG_FileHandle );
 endif;

elseif nvAnswer = FALSE then
Time();
LOG_File_Create();
WriteLine ( nvLOG_FileHandle , "NO Patches to install on this CD = Date: " + svDATE + "   Time: " + svTIME );
CloseFile ( nvLOG_FileHandle );
endif;

VarRestore ( SRCTARGETDIR );

end;


Sorry about the text formatting, I just copied and pasted.
See if this method might work for your application.


sumita

sumita
  • Members
  • 18 posts

Posted 01 June 2004 - 06:10

Thanx A lot of all the help!!.it has been really helpfull!