No announcement yet.

External Files missing from RunTime Folder being deleted in Destination

  • Filter
  • Time
  • Show
Clear All
new posts

  • External Files missing from RunTime Folder being deleted in Destination

    Let's say I have these files in my AppFolder from a previous install: MyFile1.exe, MyFile2.exe, Myfile3.exe and Myfile4.exe.

    Next I create a project with MyFile1.exe through MyFile4.exe in the External Tab with TempLaunchFolder as the RunTime Folder and the AppFolder as the Destination. Overwrite is set to IfOlder.

    Now I create a ZIP file with new versions of MyFile1.exe and MyFile2.exe (only). is included as a Primer File which will be expanded into TempLaunchfolder when the install is run.

    Lastly I add Application.IgnoreLastError() to the OnInstallError Tab to suppress the error message for the missing MyFile3.exe and MyFile4.exe when the install is run.

    When I run the setup, MyFile1.exe and MyFile2.exe are properly updated in the AppFolder to the new versions. But MyFile3.exe and MyFile4.exe are deleted from the AppFolder!

    It appears that if an External File is missing from the RunTime Folder it is also deleted in the Destination!

    Is this a bug or a feature? Is there a way to stop it from deleting files in the Destination Folder?

    I am using SUF


  • #2
    Are you running the uninstaller as part of the installation? Are you deleting files as part of your script? Please post the projects and installation log files.



    • #3
      No uninstaller, and not deleting the files as part of the script. In fact, Create Uninstall is unchecked. For debug purposes I put a Dialog.Message at the start of WhileInstalling, and another at the end. The files are definitely being deleted during the WhileInstalling phase. The OnProgress Tab is just the standard for a Scrolling Text Progress (While Installing). The code does not delete any files.


      • #4
        Regarding the Log File all I see are lines like these below. No indication in the log file that the file is being deleted from the Destination Folder.

        Success Install external file: c:\AppFolder\MyFile3.exe
        Notice Start project event: On Install Error
        Success Run project event: On Install Error
        Error Install external file: c:\AppFolder\MyFile3.exe (2)
        Success Install external file: c:\AppFolder\MyFile4.exe
        Notice Start project event: On Install Error
        Success Run project event: On Install Error
        Error Install external file: c:\AppFolder\MyFile4.exe (2)
        Last edited by commhorizons; 03-02-2015, 08:55 AM.


        • #5
          If the overwrite setting for these files is adjusted in such a way that the file should be replaced in case you are about to install a newer version, or using the "always overwrite" setting, then the current file will be deleted before the new version is copied from the source folder to the target location. The timestamp of the source file is stored in the setup during the build, it isn't checked at runtime.

          Your setup was built in such a manner that it contains information about an external file which may be newer than the local version (and as such triggering the replacement logic), but the file may actually be missing. The first step is the deletion of the current version, then the next step fails, which would be the copy of the external file to the target location.

          If it is usual that a file referenced in the setup is missing from the distribution, you may want to deploy those external files via File.Copy() actions in the On Post Install event, and remove them from the External tab. You could check if the external file exists, then verify if the local file is older, and finally perform the file copy if required.



          • #6
            Ok, that makes sense. So it sounds like at runtime the setup is getting the versions of new files from SetupData.GetFileList(EXTERNAL_LIST), not from the actual physical file that may or may not exist in the Runtime Folder?

            So it sounds like what I could do is set all the External Files to NeverOverwrite. Then at runtime, retrieve the list and do the actual version comparison with what is in the RunTime folder. If a file is not in the RunTime Folder then I leave it alone in the Destination Folder. Does that sound right?
            Last edited by commhorizons; 03-03-2015, 08:32 AM.


            • #7
              It may work, however I would use the method I described in my previous answer.