This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Knowledge Base
- :
- HOTFIX: CopyFile on Locked File Results in Installation Hanging
Subscribe
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
HOTFIX: CopyFile on Locked File Results in Installation Hanging
HOTFIX: CopyFile on Locked File Results in Installation Hanging
Summary
CopyFile does not return the correct error value when attempting to overwrite an existing locked file. This will provide the wrong value in a condition statement and prevent the custom action from closing resulting in a hanging installation.Symptoms
When attempting to overwrite a locked file with the CopyFile function, no error code is returned which results in the installation hanging. In some cases, it will immediately go straight to the SetupCompleteError dialogCause
This behavior is caused by an issue with InstallShield 2013 and InstallShield 2014.Steps To Reproduce
- Create a new Basic MSI project
- Use the function example below as an InstallScript custom action (this is pulled from the CopyFile help example)
- In the Custom Actions view, add the ExFn_CopyFile to run after CostFinalize in the UI sequence
- Set the Return Processing property to Synchronous (Check exit code)
- Build the project using the default releases values
- Copy the newly created executable to both "C:\Target" and "C:\Source" or new values if you modified the sample listed above
- Launch the executable file copied to "C:\Target" and leave the process running
- Launch the executable from the original build location
- Message box with ?An unspecified error occurred? displays as the results are not returned properly and the installation is unable to proceed
#define SOURCE_DIR "C:\\Source" #define TARGET_DIR "C:\\Target" // Include Ifx.h for built-in InstallScript function prototypes. #include "Ifx.h" export prototype ExFn_CopyFile(HWND); function ExFn_CopyFile(hMSI) NUMBER nResult; begin // Copy all files in the source directory, including files // in subdirectories, to the target directory. nResult = CopyFile(SOURCE_DIR ^ "*.*", TARGET_DIR ^ "*.*"); // Report the results of the copy operation. switch (nResult) case 0: MessageBox ("Files successfully copied.", INFORMATION); case COPY_ERR_CREATEDIR: MessageBox ("A target directory could not be created.", SEVERE); case COPY_ERR_MEMORY: MessageBox ("Insufficient memory.", SEVERE); case COPY_ERR_NODISKSPACE: MessageBox ("Insufficint disk space.", SEVERE); case COPY_ERR_OPENINPUT: MessageBox ("Unable to open the input files in "+ SOURCE_DIR +".", SEVERE); case COPY_ERR_OPENOUTPUT: MessageBox ("Unable to copy the source files.", SEVERE); case COPY_ERR_TARGETREADONLY: MessageBox ("A target file already exists and cannot be overwritten.", SEVERE); default: MessageBox ("An unspecified error occurred.", SEVERE); endswitch; end;
Resolution
This issue has been submitted as a bug to our Engineering team. The issue is being tracked under issue #IOJ-1667248.To apply the HotFix attached below, please do the following steps:
- Close IS 2014 SP 1.
- Rename the following files by prepending ORIG_ to the file name:
C:\Program Files (x86)\InstallShield\2014\Redist\Language Independent\i386\ISSetup.dll
C:\Program Files (x86)\InstallShield\2014\Redist\Language Independent\i386\ISP\ISSetup.dll
C:\Program Files (x86)\InstallShield\2014\Redist\Language Independent\i386\ISP\ISSetup.dll
3. Copy the HotFixed versions of ISSetup.dll to their respective locations on the target machine.
4. Launch IS 2014 SP 1 and rebuild the project.
Related KB Articles
InstallShield 2014 Known Issues
No ratings