cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AlistairC
Level 2

DeleteFile() Can't Handle Some Filenames with Multiple . (period)

I have an Install Script project for IS 2012 which I have taken over from another developer.
I have been asked to update the installer and several fiiles have been replaced by new files with different names.

I have an event handler to my script which calls DeleteFile() method from the InstallScript api

I have a problem, though, with the DeleteFile() function.

DeleteFile() can delete files named in this style -

Planoreport.js
or
storePOGs.js

But DeleteFile() is unable to delete files named like this -

jquery-1.7.2.min.js

We have several files named like this. It is a standard convention for javascript and css files so there is nothing unusal about the naming convertion but DeleteFiles() seems unable to delete them leaving some files deleted, others not deleted.

Is this a bug with DeleteFiles() ?

Alternatively, can anyone please suggest a workaround?

I tried wildcard and DeleteDir() as well but same problem.

Thanks in advance.
Labels (1)
0 Kudos
(1) Reply
phill_mn
Level 7

I would convert the path to a short name first, using LongPathToShortPath (svPathToExistingFile); I think I have done the same thing previously in my projects.
0 Kudos