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

using deletedir command


3 replies to this topic

adrian

adrian
  • Members
  • 2 posts

Posted 14 January 2004 - 15:51

Hi,

Using InstallShield 6.2 having a problem where the old files on a C drive are updated with new files selected in the InstallShield build.

Within the script at the function 'ProcessBeforeDataMove' we have
DeleteDir ( " c:\name of dir." , ALLCONTENTS) ;

We need to include this as we are installing new files into the directory we are deleting.

Withing 'MoveFileData' section of the script we create the directory again.
CreateDir ( " c:\name of dir." )

We build the InstallShield and it works BUT when we check our C drive to check weither the directory has been deleted and created again with the new files it hasn't.

BUT if we delete the directory physically ourselves and run the InstallShield, It creates the new directory we wish with the new files we need.

Not very experienced at InstallShield as you can tell but any hints or tips using 6.2 Installshield would be very grateful.

Cheers
Adrian sad.gif

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 14 January 2004 - 20:34

You need to use double backslashes:
DeleteDir ( " c:\\name of dir." , ALLCONTENTS) ;

adrian

adrian
  • Members
  • 2 posts

Posted 15 January 2004 - 11:20

Thank you for replying,

Just checked our application. we are using double backslashes \\ and for deleting and creating and it still is not working. sad.gif

Ozone

Ozone
  • Full Members
  • 77 posts

Posted 15 January 2004 - 15:39

Without seeing more of your script, I can only make some guesses as to why the directory and its contents are not being deleted. You need to check the return value of the nRetrunValue = DeleteDir(szDir, nFlag) command. Remember, you cannot delete the ‘current’ directory, so make sure you ChangeDirectory(szPath) to another directory before you delete. Do you check to see if the user has the appropriate rights to delete files? Your machine might have the rights, but the customer’s machine could be in any condition. And lastly, make sure to remove any read-only attributes from all the files in the folder. DeleteDir cannot delete read-only, hidden, or system files.