Copy OR Move Commands

Got a problem you cannot solve? Try here.
rev23dev
Posts: 132
Joined: Tue May 12, 2009 2:42 pm

Re: Copy OR Move Commands

Postby rev23dev » Wed Oct 19, 2016 8:02 pm

I was having a similar issue. Following advice in this thread I wrapped my Copy into enabling then disabling the native engine. Sure enough that fixed it. Why does this work?

Also Is there a way to overwrite the file if it exists without the prompt?

SITL
Posts: 116
Joined: Tue Sep 27, 2016 12:31 am

Re: Copy OR Move Commands

Postby SITL » Fri Nov 11, 2016 6:13 am

Dear Francesco Toscano & Bokkie,

Hope you are doing Great !

Hey, using NATIVE_ENGINE is causing some problem...

You have suggested me following solution for copying files.....
if Variable SUCCESS Equals COMPLETE
Set Variable NATIVE_ENGINE to TRUE
Copy Local Files $LiccenseFilePath$\$LicenseFileName$ to $TARGETDIR$\$LicenseFileName$
Set Variable NATIVE_ENGINE to FALSE
end


After using NATIVE_ENGINE, Copying files is fine.
But Uninstallation is NOT WORKING.
surprised, it was hard to actually pin point the problem(I had other changes as well).
Yes, It is this particular statement which is causing Uninstallation problem.

Problem description:
I installed my program, everything is fine.
Uninstall thro' start menu short cut, looking OK, Got a message saying uninstallation is successful.
but short cut & All the files were intact.
then click uninstall link again on the start menu.
it asked me to select the proper file (Note: first time it won't ask - Obvious ).
I selected the proper file.
Uninstallation is successful. This time all the files were removed.

Appreciate your suggestion.
Thanks
SITL

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

Re: Copy OR Move Commands

Postby FrancescoT » Fri Nov 11, 2016 2:45 pm

Dear SITL,

of course those files are NOT removed when uninstalling. Those operations executed under Native Engine are not included with the MSI database and consequently, the MSI engine cannot handle these when uninstalling.

To solve your problem, you may use the following approach just after your Apply Uninstall command;

Code: Select all

Apply Uninstall (get result into variable SUCCESS)
   
  if Variable SUCCESS Equals COMPLETE
    Set Variable NATIVE_ENGINE to TRUE
    Delete Files $TARGETDIR$\$LicenseFileName$
    Set Variable NATIVE_ENGINE to FALSE
  end

In case you need to delete the TARGETDIR also (it must be an empty folder), you may use the approach described by the following link.
http://www.installaware.com/forum/viewtopic.php?f=2&t=10457&hilit=+RemoveDirectory

Hope this helps you.

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

SITL
Posts: 116
Joined: Tue Sep 27, 2016 12:31 am

Re: Copy OR Move Commands

Postby SITL » Mon Nov 14, 2016 3:36 am

Dear Francesco Toscano,

Thanks for your reply.

Your advice -
Apply Uninstall (get result into variable SUCCESS)

if Variable SUCCESS Equals COMPLETE
Set Variable NATIVE_ENGINE to TRUE
Delete Files $TARGETDIR$\$LicenseFileName$
Set Variable NATIVE_ENGINE to FALSE
end


This won't work as expected, Registry cleanup won't happen, Sub folders & Short cuts will remain.
more details later . .
( I have other point to clarify )

So, Let me bring up my earlier post - ( i want to understand )
Problem description:
STEP 1> I installed my program, everything is fine.
STEP 2> Uninstall thro' start menu short cut, looking OK, Got a message saying uninstallation is successful.
but short cut & All the files were intact.

STEP 3> Then click uninstall link again on the start menu.
STEP 4> It asked me to select the proper file (Note: first time it won't ask - Obvious ).
STEP 5> I selected the proper file.
Uninstallation is successful. This time all the files were removed.

My question is,How is it possible ?
When i ran the uninstall second time, everything is cleaned properly.Even the files copied by enabling NATIVE_ENGINE are also deleted.

Appreciate your advice
Regards
SITL

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

Re: Copy OR Move Commands

Postby FrancescoT » Mon Nov 14, 2016 10:22 am

Dear SITL,

I can only suppose that there is something wrong with your script. Probably some commands are not sequenced correctly, but it's quite difficult to identify the error without having your files.

If you have any change to post a very minimal project that replicates the issue, I'll try to have a look.

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

SITL
Posts: 116
Joined: Tue Sep 27, 2016 12:31 am

Re: Copy OR Move Commands

Postby SITL » Tue Nov 15, 2016 5:06 am

Dear Francesco Toscano,

Thanks for your suggestion.
It worked, I had deleted some statements :wink:

Bye
SITL

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

Re: Copy OR Move Commands

Postby FrancescoT » Tue Nov 15, 2016 10:26 am

:D
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 106 guests