Page 1 of 1

kernel32.dll->RemoveDirectoryA fails on X2

Posted: Tue Oct 06, 2015 4:32 am
by pldragun
Hi,
In the process of migration from Install Aware ver.12 to X2 I have found that "kernel32.dll->RemoveDirectoryA" calls started failing. Could you please help with this issue?

It would be preferable to find solution which will work with both ver.12 and X2/3 since we have some scripts shared among new and old products.

Re: kernel32.dll->RemoveDirectoryA fails on X2

Posted: Tue Oct 06, 2015 12:06 pm
by FrancescoT
Dear Pldragun,

Try to use the UNICODE version of the WINAPI instead.

Code: Select all

~InstallAware Clipboard Data~
~Call DLL Function~
~{6D0C9E4A-CDA1-4E22-B5DF-D32B18554E29}~
~kernel32.dll,RemoveDirectoryW,bool,,"pointer to UNICODE string",$MYPATH$,$~
~mIDEFunc.dll\mEXEFunc.dll~
~Set Variable~
~{A99EBE41-C372-46D0-BB94-A86ACC083150}~
~MYPATH$MYAH$MYAH$FALSE~
~F:\mypath~
~Comment~
~{03C385D7-034F-4356-B4CF-79DC93BC511A}~
~UNICODE~


Code: Select all

Comment: UNICODE
Set Variable MYPATH to F:\mypath
Call DLL Function kernel32.dll->RemoveDirectoryW


Regards

Re: kernel32.dll->RemoveDirectoryA fails on X2

Posted: Tue Oct 06, 2015 12:19 pm
by pldragun
I tried to use "Delete Files Recursive" with path to the folder (emptied before) as a parameter - it looks working. Is it a way?

Re: kernel32.dll->RemoveDirectoryA fails on X2

Posted: Tue Oct 06, 2015 12:28 pm
by FrancescoT
It's also correct your approach.

Regards.

Re: kernel32.dll->RemoveDirectoryA fails on X2

Posted: Tue Oct 06, 2015 1:10 pm
by pldragun
Unfortunately RemoveDirectoryW (param = pointer to UNICODE string) causes the same script failure with X2.
Besides that, there is no such parameter type on ver12 so it will be impossible to use the same script code for both variants.

Re: kernel32.dll->RemoveDirectoryA fails on X2

Posted: Wed Oct 07, 2015 11:29 am
by FrancescoT
Dear Pldragun,

Of course the UNICODE version of "RemoveDirectory" (RemoveDirectoryW) can be exclusively used with UNICODE versions of IA.

That said it must work on IA X2, I use the same with my projects without problems.

Regards