vb.net - Use Shell32.dll on mix of XP, Vista, Win7 via XCOPY deploy -


i'm trying use shell32.dll unzip simple compressed file. have reference shell32.dll shows interop.shell.dll on development pc (win7 64.) push exe updates out via file copy central location , .dll well.

the program fails on xp using same file installed on pc. tried using shell.dll xp \windows\system renamed interop.shell.dll guess simple - gets error cannot load when try invoke dll.

i'm open way of doing unzip uses dll agnostic platform. i've used 7zip via process.start() i'd avoid having install/update program on clients.

is there common denominator shell32.dll use run on win os on/after xp?

or have create separate build each os if use shell32.dll?

thanks!

function unzip(filepathofzip string, destinationfolder string) boolean     try         dim sfile string = filepathofzip         ' requires referenc windows.system.shell32.dll         dim sc new shell32.shell()          if io.directory.exists(destinationfolder) io.directory.delete(destinationfolder, true)         application.doevents()         io.directory.createdirectory(destinationfolder)         'declare folder files extracted         dim output shell32.folder = sc.namespace(destinationfolder)          if filepathofzip.endswith(".kmz")             sfile = filepathofzip & ".zip"             io.file.move(filepathofzip, sfile)             application.doevents()         end if          'declare input zip file folder          dim input shell32.folder = sc.namespace(sfile)         'extract files zip file using copyhere command .         output.copyhere(input.items, 4)         return true     catch ex exception         msgbox(ex.message)         return false     end try end function 

i switched dotnetzip. add project reference ionic.zip.reduced.dll. imports ionic.zip

this code expecting .kmz files downloaded esri rest services should work .zip files well.

function unzip(filepathofzip string, destinationfolder string) boolean     ' extract .kmz files downloaded esri rest services     try         dim sfile string = filepathofzip          if io.directory.exists(destinationfolder) io.directory.delete(destinationfolder, true)         application.doevents()         io.directory.createdirectory(destinationfolder)          if filepathofzip.endswith(".kmz")             sfile = filepathofzip & ".zip"             io.file.move(filepathofzip, sfile)             application.doevents()         end if          try             ' using... required             using zip zipfile = zipfile.read(sfile)                 dim e zipentry                 each e in zip                     e.extract(destinationfolder)                 next             end using         catch ex1 exception             msgbox("problem compressed file - notify programmers" & vbcrlf & ex1.message)             return false         end try          return true     catch ex exception         msgbox(ex.message)         return false     end try end function 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -