Hi,
I'm pretty new to InstallAware (formerly used WISE) and am trying to convert an "old" installation to it. From another thread I learned that the CALL DLL function can be used to execute kernel32.dll's MoveFile or MoveFileA command - but actually I really can't get it working. Is there any place where I can see some examples on how to address DLL functions this way (which entries have to made in which fields of the dialogue?) or at least any for MoveFile?
I would be glad to get any clue - thanks in advance,
Bernd Hoffmann
GEKKO Software
Example für CALL DLL function/MoveFile
Re: Example für CALL DLL function/MoveFile
Dear Bernd,
Instead, you can use the built in and integrated Copy / Move Local Files InstallAware command - why call a 3rd party dll if you have a better alternative?
Instead, you can use the built in and integrated Copy / Move Local Files InstallAware command - why call a 3rd party dll if you have a better alternative?
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
Obliterator
- Posts: 53
- Joined: Fri May 01, 2009 11:54 am
Re: Example für CALL DLL function/MoveFile
One issue is IA's copy/move commands only work during the Apply Install state.
Sometimes I found it necessary to copy/move files before this point (say before an upgrade uninstall deletes the file I wanted).
As it's advised against calling Apply Install multiple times, the only solution I found was to use kernel copy/move via dll call to kernel32.dll
If you want to go ahead, its fairly straightforward.
Define some parameters first:
Set Variable COPYRESULT to FALSE
Set Variable CPYSRCFILE to "<path and filename of file to be copied>"
Set Variable CPYDESTFILE to "<destination path and filename>"
Then simply add the Call DLL Function command to your script and specify the parameters as follows:
DLL Path: kernel32.dll
Function Name: CopyFileA
Add three parameters of the following Type / Value:
allocated string buffer (MAX_PATH length) / $CPYSRCFILE$
allocated string buffer (MAX_PATH length) / $CPYDESTFILE$
bool / FALSE
Return Type: bool
Return result in variable: COPYRESULT
Call DLL Function kernel32.dll->CopyFileA (get result into variable COPYRESULT)
Finally test COPYRESULT for success and handle accordingly.
Sometimes I found it necessary to copy/move files before this point (say before an upgrade uninstall deletes the file I wanted).
As it's advised against calling Apply Install multiple times, the only solution I found was to use kernel copy/move via dll call to kernel32.dll
If you want to go ahead, its fairly straightforward.
Define some parameters first:
Set Variable COPYRESULT to FALSE
Set Variable CPYSRCFILE to "<path and filename of file to be copied>"
Set Variable CPYDESTFILE to "<destination path and filename>"
Then simply add the Call DLL Function command to your script and specify the parameters as follows:
DLL Path: kernel32.dll
Function Name: CopyFileA
Add three parameters of the following Type / Value:
allocated string buffer (MAX_PATH length) / $CPYSRCFILE$
allocated string buffer (MAX_PATH length) / $CPYDESTFILE$
bool / FALSE
Return Type: bool
Return result in variable: COPYRESULT
Call DLL Function kernel32.dll->CopyFileA (get result into variable COPYRESULT)
Finally test COPYRESULT for success and handle accordingly.
Re: Example für CALL DLL function/MoveFile
Which InstallAware version are you using?
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
Obliterator
- Posts: 53
- Joined: Fri May 01, 2009 11:54 am
Re: Example für CALL DLL function/MoveFile
Me? I'm using IA9 R2 SP3.070910.
Why do you ask?
Why do you ask?
Re: Example für CALL DLL function/MoveFile
I ask because InstallAware 10 introduced the Native Engine which allows you to run commands immediately without waiting for the Apply Changes command..
Please paste (or send to support at installaware.com) your actual script file (.mia).
Please paste (or send to support at installaware.com) your actual script file (.mia).
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
Obliterator
- Posts: 53
- Joined: Fri May 01, 2009 11:54 am
Re: Example für CALL DLL function/MoveFile
No need, the DLL workaround works fine for me as is.
I needed to retain a file on the user's pc when upgrading a legacy installer.
It was just the only way I could find at the time to ensure my file got copied before it got removed!
There was probably another way but that was quick and painless.
The rest of my files are all installed properly with IA via MSI.
I was just trying to help this user get to grips with the Call DLL method if he needs it.
Thanks anyhow
I needed to retain a file on the user's pc when upgrading a legacy installer.
It was just the only way I could find at the time to ensure my file got copied before it got removed!
There was probably another way but that was quick and painless.
The rest of my files are all installed properly with IA via MSI.
I was just trying to help this user get to grips with the Call DLL method if he needs it.
Thanks anyhow

