Topic: Call,Download  (Read 2068 times)

0 Members and 1 Guest are viewing this topic.

Call,Download
« on: April 22, 2016, 04:18:35 PM »

Prz42

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2014
  • Posts: 431
When I use this it fails
Code: [Select]
Call,Download,%ProvideFiles%,%Install_File%,%SetupURL%
But when I use the older method it works
Code: [Select]
Run,%ScriptFile%,Download_Files,%ProvideFiles%,%Install_File%,%SetupURL%,NoExit

[Download_Files]
If,#4-,Equal,-,Set,#4,Exit
If,Not,ExistDir,%ProjectTemp%,DirMake,%ProjectTemp%
If,ExistFile,%ProjectTemp%\#2,Call,FileDelete,%ProjectTemp%\#2
Run,%ScriptFile%,Download_Files_Wget,%ProjectTemp%\#2,#3,#4
If,Not,ExistDir,#1,DirMake,#1
If,ExistFile,%ProjectTemp%\#2,FileCopy,%ProjectTemp%\#2,#1

[Download_Files_Wget]
Set,#9,""
If,#3,Equal,Exit,Set,#9," - Exiting
If,Not,ExistFile,%tools%\WGet.exe,Exit,"%tools%\WGet.exe Not Found"
If,Not,ExistFile,%tools%\msvcr71.dll,Exit,"%tools%\msvcr71.dll Not Found"
If,Not,ExistDir,%ProjectTemp%,DirMake,%ProjectTemp%
ShellExecute,Open,%Tools%\wget.exe,"-t 6 -O #$q#1#$q #$q#2#$q"
Set,%t%,%ExitCode%
If,Not,%t%,Equal,0,Call,FileDelete,#1
If,Not,%t%,Equal,0,Message,"Failed downloading #1! - Wget Failure#9",Error,10
If,Not,%t%,Equal,0,Call,Echo,"Failed downloading #1! - Wget Failure#9",Warn
If,Not,%t%,Equal,0,If,#3,Equal,Exit,Exit,"Failed downloading #1! - Wget Failure#9"
Set,#8,0
If,ExistFile,#1,Retrieve,FileSize,#1,#8
If,ExistFile,#1,If,#8,Smaller,100,Call,FileDelete,#1
If,Not,ExistFile,#1,Message,"Failed downloading #1! - Wget Failure#9",Error,10
If,Not,ExistFile,#1,Call,Echo,"Failed downloading #1! - Wget Failure#9",Warn
If,Not,ExistFile,#1,If,#3,Equal,Exit,Exit,"Failed downloading #1! - Wget Failure#9"
Also while I have the wizard, I use this line
Code: [Select]
[Install_Version]
Set,%ProvideFiles%,%ProgramFilesDir%\Acronis\BootableComponents\WinPE
Echo,"Extracting %ScriptTitle% WinPE Files......From Host Installed Directory....Please be Patient........"
But I have to use this line for it to work half the time or it fails
Code: [Select]
[Install_Version_x64]
Set,%ProvideFiles%,"C:\Program Files (x86)\Acronis\BootableComponents\WinPE"
Echo,"Extracting %ScriptTitle% WinPE Files......From Host Installed Directory (x86)....Please be Patient........"

Re: Call,Download
« Reply #1 on: April 22, 2016, 11:27:13 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7175
When I use this it fails
Code: [Select]
Call,Download,%ProvideFiles%,%Install_File%,%SetupURL%

Because you use wrong syntax.

Call,Download
syntax well documented, check
Call Topic
http://theoven.org/index.php?topic=45.0
« Last Edit: April 23, 2016, 07:22:53 AM by Lancelot »

Re: Call,Download
« Reply #2 on: April 23, 2016, 12:08:11 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
AH, he has space after call

Re: Call,Download
« Reply #3 on: April 23, 2016, 05:18:04 AM »

Prz42

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2014
  • Posts: 431
Because you use wrong syntax.
It works perfect with
Code: [Select]
[Download]
Echo,"Your files are being Downloaded from the Internet"
Call,Download,%ProvideFiles%\%Install_File%,%SetupURL%
Call,OpenDir,%ProvideFiles%
Your Macro Library make life easier.        :scooter:
Do you know why this only works half the time
Code: [Select]
[Install_Version]
Set,%ProvideFiles%,%ProgramFilesDir%\Acronis\BootableComponents\WinPE
Echo,"Extracting %ScriptTitle% WinPE Files......From Host Installed Directory....Please be Patient........"
But using this it works all the time
Code: [Select]
[Install_Version_x64]
Set,%ProvideFiles%,"C:\Program Files (x86)\Acronis\BootableComponents\WinPE"
Echo,"Extracting %ScriptTitle% WinPE Files......From Host Installed Directory (x86)....Please be Patient........"

Re: Call,Download
« Reply #4 on: April 23, 2016, 07:31:52 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7175
Do you know why this only works half the time
I do not, besides I already implemented such features to Macro Library to avoid winbuilder bugs on this area :wink:
ps: you can not find bulk variables like %ProgramFilesDir% on any plugin  :wink:


See Call,Host<Folder> at same Call topic
Call Topic
http://theoven.org/index.php?topic=45.0

I guess what you need is
Code: [Select]
Call,HostProgramFilesDirX86
Set,%ProvideFiles%,%HostProgramFilesDirX86%\Acronis\BootableComponents\WinPE


ps: verify also on host x86, I can only test here on host x64 ....

Code: [Select]
Call,HostProgramFilesDirX86
Echo,%HostProgramFilesDirX86%

Re: Call,Download
« Reply #5 on: April 23, 2016, 11:56:59 AM »

Prz42

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2014
  • Posts: 431
Do you know why this only works half the time
I do not, besides I already implemented such features to Macro Library to avoid winbuilder bugs on this area :wink:
ps: verify also on host x86, I can only test here on host x64 ....

Code: [Select]
Call,HostProgramFilesDirX86
Echo,%HostProgramFilesDirX86%
It worked in x86 Host.  I saw a Call,HostProgramFilesDir in Macro Library.
Guess you don't need it as Call,HostProgramFilesDirX86 works for both Arch?

Thanks for the help      :scooter:

Re: Call,Download
« Reply #6 on: April 24, 2016, 01:01:01 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7175
It worked in x86 Host.  I saw a Call,HostProgramFilesDir in Macro Library.
Guess you don't need it as Call,HostProgramFilesDirX86 works for both Arch?

on your above special case, following your example,
Call,HostProgramFilesDirX86
is enough  :thumbsup:

On General:
You need both  :wink: on your other plugins in future.
ex:
You will need both (or other) on future Acronis editions on your future Acronis plugins

ps: If not understood, do not worry, when you need such things you now know they are available and you will remember.  :thumbsup:

:turtle:

Re: Call,Download
« Reply #7 on: April 24, 2016, 06:03:09 AM »

Prz42

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2014
  • Posts: 431
On General:
You need both  :wink: on your other plugins in future.
ex:
You will need both (or other) on future Acronis editions on your future Acronis plugins

ps: If not understood, do not worry, when you need such things you now know they are available and you will remember.  :thumbsup:

:turtle:
I thought this might be the best method?
Code: [Select]
[process]
Run,%ScriptFile%,Setup_Directory

[Setup_Directory]
Call,HostProgramFilesDirX86
Set,%ProvideFiles%,%HostProgramFilesDirX86%\Acronis\BootableComponents\WinPE
If,Not,ExistFile,%ProvideFiles%\%SetupFile%,Call,HostProgramFilesDir
Set,%ProvideFiles%,%HostProgramFilesDir%\Acronis\BootableComponents\WinPE
If,Not,ExistFile,%ProvideFiles%\%SetupFile%,Set,%ProvideFiles%,%GlobalTemplates%\%ProgramSourceFiles%
If,ExistFile,%ProvideFiles%\%SetupFile%,Echo,"Extracting %ProvideFiles%.. Files......Please be Patient........"
If,Not,ExistFile,%ProvideFiles%\%SetupFile%,Message,"Unable to find file %SetupFile% #$x#$xPlease check Acronis Backup Bootable Media Builder is installed",ERROR
If,Not,ExistFile,%ProvideFiles%\%SetupFile%,Exit,"-"
Thanks for your help      :scooter:

Re: Call,Download
« Reply #8 on: April 24, 2016, 10:37:26 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7175
I thought this might be the best method?

I do not know, your plugin  :thumbsup: I only quick look codes.

+
there seems to be mixed + wrong logic on some steps with HostProgramFilesDir

+
added Call,Echo + message 5 seconds
(1 line Call,Echo + better not stop build => Message Error + 10 warnings on log  :wink: )

ref:
Call Topic
http://theoven.org/index.php?topic=45.0
Call,Echo

here fixed:

Code: [Select]
[Process]
Run,%ScriptFile%,Setup_Directory

[Setup_Directory]
Call,HostProgramFilesDir
Call,HostProgramFilesDirX86
Set,%ProvideFiles%,%HostProgramFilesDirX86%\Acronis\BootableComponents\WinPE
If,Not,ExistFile,%ProvideFiles%\%SetupFile%,Set,%ProvideFiles%,%HostProgramFilesDir%\Acronis\BootableComponents\WinPE
If,Not,ExistFile,%ProvideFiles%\%SetupFile%,Set,%ProvideFiles%,%GlobalTemplates%\%ProgramSourceFiles%
If,ExistFile,%ProvideFiles%\%SetupFile%,Echo,"Extracting %ProvideFiles%.. Files......Please be Patient........"
Call,Echo,"Unable to find file %SetupFile% #$x#$xPlease check Acronis Backup Bootable Media Builder is installed",Warn,,MessageError,5,Exit


:turtle:

 

Powered by EzPortal