How can I create and delete a network drive from inno-setup?

I am writing an inno-setup script that needs to run a very old third-party setup application, this old installer (called setup.exe) works only from the root folder (if not crashing), so I need to create (and delete) a network drive to copy files of this installer, and then run setup.exe. so the question is, how can I create and delete a network drive from inno-setup? I am looking at something like WNetAddConnection .

+4
source share
1 answer

You can use the WshNetwork Object, which is part of the Windows Script Host

 var WshNetWork : Variant; begin WshNetWork:=CreateOleObject('WScript.Network'); //create the network drive WshNetwork.MapNetworkDrive('H:', '\\localhost\c$\data'); //do your stuff here //remove the network drive WshNetwork.RemoveNetworkDrive('H:'); end; 
+5
source

All Articles