kernel32.dll->RemoveDirectoryA fails on X2

Got a problem you cannot solve? Try here.
pldragun
Posts: 3
Joined: Tue Oct 06, 2015 4:27 am

kernel32.dll->RemoveDirectoryA fails on X2

Postby pldragun » Tue Oct 06, 2015 4:32 am

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: kernel32.dll->RemoveDirectoryA fails on X2

Postby FrancescoT » Tue Oct 06, 2015 12:06 pm

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

pldragun
Posts: 3
Joined: Tue Oct 06, 2015 4:27 am

Re: kernel32.dll->RemoveDirectoryA fails on X2

Postby pldragun » Tue Oct 06, 2015 12:19 pm

I tried to use "Delete Files Recursive" with path to the folder (emptied before) as a parameter - it looks working. Is it a way?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: kernel32.dll->RemoveDirectoryA fails on X2

Postby FrancescoT » Tue Oct 06, 2015 12:28 pm

It's also correct your approach.

Regards.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

pldragun
Posts: 3
Joined: Tue Oct 06, 2015 4:27 am

Re: kernel32.dll->RemoveDirectoryA fails on X2

Postby pldragun » Tue Oct 06, 2015 1:10 pm

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: kernel32.dll->RemoveDirectoryA fails on X2

Postby FrancescoT » Wed Oct 07, 2015 11:29 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 147 guests