Does anyone already have the code to stop the installer if it was run from a unc path. I need all of our installers to only run from a drive letter.
Professional Software Development Tools
Does anyone already have the code to stop the installer if it was run from a unc path. I need all of our installers to only run from a drive letter.
What about checking the value of _SourceFolder or even _SourceDrive?
Along the lines of Brett's suggestion - here's a bit of code.
place the function in Global Functions if you wish
and call it from the 'On Startup' actions.
Code:function IsFixedDrive() local tDrvs = Drive.Enumerate(); bFixed_drv = false; local D_verify = String.Mid(_SourceFolder, 1, 3); for n, drv in tDrvs do if (Drive.GetType(drv) == 3) then --fixed only if (String.CompareNoCase(drv, D_verify) == 0) then Dialog.Message("Confirmed Fixed Drive", drv); --delete bFixed_drv = true; break; end end end return bFixed_drv; end --to call it if (not IsFixedDrive()) then Application.Exit(0); --change to suit end
HTH
You guys Rock ! thanks worked great...