SILENTIUM! | ScriptSpot
Sat Jan 01 2022 01:43:50 GMT+0000 (Coordinated Universal Time)
Saved by
@junks
-- maybe the installation proccess need to check is folder writable, in case you re not admin
--for max 2010 below till max 9 , I think
fn isFolder folder: =
(
local state = false
if (paths!=unsupplied and doesFileExist folder) do
(
local netFile = dotnetClass "System.IO.File"
local fileAttr = netFile.GetAttributes folder
local strArr = filterString (fileAttr.ToString()) ","
if (strArr.count!=0 ) do
(
if ((stricmp strArr[1] "Directory")== 0) do (state=true )
)
)
state
)
fn isWritableFolder folder: =
(
local fail =false
local thePath = dotnetClass "System.IO.Path"
local file = dotnetClass "System.IO.File"
local fileOption = dotnetClass "System.IO.FileOptions"
if (folder==unsupplied ) do return fail
if (isFolder paths:folder) do
(
try
(
fs =file.Create (thePath.Combine #(folder,thePath.GetRandomFileName())) 1 fileOption.DeleteOnClose
fs.Dispose();fs.close()
fail = true
)
catch ()
)
fail
)
--- or for max 2010 above
--- iswriteable folder function
content_copyCOPY
http://www.scriptspot.com/3ds-max/scripts/silentium
Comments