PDA

View Full Version : Freeze in installation with custom action



LanceRas
08-22-2014, 06:07 PM
Basic MSI project. Goal is to copy data from a prior edition product to new edition product. Search is set to look for 4 of our past products installed.

I have 4 custom actions pointing to installscript functions that copy the data from that particular edition to the new edition. Logic for those custom actions are set so that we look for the newest of the 4 products previously installed and do that custom action and not the others. If prior products were not installed, then the logic wont match any, skipping the actions of copying past data.

For some unknown reason, some customers are getting hung up during the copying of the past information. If they override the installer property in a window to skip installing past data and these actions are skipped, the installer finishes successfully.

Any ideas? I'm not seeing pattern on OS installs.

The code for the function for copying the prior version data to new version data is:

//////////////////////////////////////////////
function CopyPastData1(hMSI)
// To Do: Declare local variables.
STRING svCommonDocuments, svPath, svProgFilesFolder;
STRING svSource, svDestination;
NUMBER nvSize, nvKeepReg, nvFolder, nvResult;
begin
SprintfMsiLog("Copy Old data 1Start.....");
Enable(STATUS);
StatusUpdate (ON, 99);
svCommonDocuments="";
svProgFilesFolder="";
try
nvFolder=CSIDL_COMMON_DOCUMENTS;
svPath="";
svCommonDocuments="";
nvResult=SHFolder.SHGetFolderPathA(NULL, nvFolder, NULL, 0, svPath);
if (nvResult=0) then
svCommonDocuments=svPath;
else
SprintfBox(SEVERE, "CSIDL_COMMON_DOCUMENTS", "Failed(%d): %s", nvResult, FormatMessage(nvResult));
endif;
catch
MessageBox("Unsupported OS.",0);
endcatch;
svDestination = svCommonDocuments ^ "\\NewProgram\\Data\\" ^ "*.*";
nvSize=0;
MsiGetTargetPath(ISMSI_HANDLE, "ProgramFilesFolder", svProgFilesFolder, nvSize);
svSource = svCommonDocuments ^ "\\PASTPROGRAM\\DATA\\*.*";
Disable(LOGGING);
XCopyFile (svSource, svDestination, COMP_NORMAL);
svDestination = svCommonDocuments ^ "\\NEWPROGRAM\\NEWPROGRAM.INI";
svSource = svCommonDocuments ^ "\\PASTPROGRAM\\PASTPROGRAM.ini";
CopyFile ( svSource , svDestination );

WriteProfString (svDestination, "Last File","which_Directory","0");
WriteProfString (svDestination, "Last File","Specific_Directory","");
WriteProfString (svDestination, "Last File","Last Directory","");
WriteProfString (svDestination, "Last File","Open Last File","0");
WriteProfString (svDestination, "Last File","Last File","");
WriteProfString (svDestination, "Last File","Last Name","");
WriteProfString (svDestination, "Last File","Last File 1","");
WriteProfString (svDestination, "Last File","Last Name 1","");
WriteProfString (svDestination, "Last File","Last File 2","");
WriteProfString (svDestination, "Last File","Last Name 2","");
WriteProfString (svDestination, "Last File","Last File 3","");
WriteProfString (svDestination, "Last File","Last Name 3","");
WriteProfString (svDestination, "Last File","Last File 4","");
WriteProfString (svDestination, "Last File","Last Name 4","");
WriteProfString (svDestination, "Last File","Last File 5","");
WriteProfString (svDestination, "Last File","Last Name 5","");
WriteProfString (svDestination, "Last File","Last File 6","");
WriteProfString (svDestination, "Last File","Last Name 6","");
WriteProfString (svDestination, "Last File","Last File 7","");
WriteProfString (svDestination, "Last File","Last Name 7","");
WriteProfString (svDestination, "Last File","Last File 8","");
WriteProfString (svDestination, "Last File","Last Name 8","");
WriteProfString (svDestination, "Last File","Last File 9","");
WriteProfString (svDestination, "Last File","Last Name 9","");
WriteProfString (svDestination, "Last File","Last File 10","");
WriteProfString (svDestination, "Last File","Last Name 10","");
WriteProfString (svDestination, "Last File","Last File 11","");
WriteProfString (svDestination, "Last File","Last Name 11","");
WriteProfString (svDestination, "Last File","Last File 12","");
WriteProfString (svDestination, "Last File","Last Name 12","");
WriteProfString (svDestination, "Program Default","Copied Sample File","0");

SetStatusWindow (-1, "Copying completed at 99%");
Delay (3);
SetStatusWindow (100, "Completed copying.");
Delay (3);
Enable(LOGGING);
SprintfMsiLog("Copy Old data End.....");
end;