Topic: How to get one Plugin to run another then exit  (Read 1231 times)

0 Members and 1 Guest are viewing this topic.

How to get one Plugin to run another then exit
« on: October 08, 2015, 07:34:48 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
I would like to have one plugin run/call another plugin, then exit the current plugin - not sure this is correct..
But think you can get the gist of what I am wanting to do..

Code: [Select]
If,Not,%SourceArch%,Equal,x64,Begin
  If,ExistFile,%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script,Begin
    Echo,"Acronis True Image 2014 is for x86 Builds",Warn,,MessageError  //-- Or Question,
    //- echo, Would you like to install 2014 instead
   //-- If,true, Begin
      Run,%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script
      Exit  //- (current script)
   Else,Begin
   call,Echo,"Acronis True Image 2016 is only for 64-Bit Builds!",Warn,,MessageError,,Exit
  End
End
« Last Edit: October 08, 2015, 07:49:16 AM by KYHI »

Re: How to get one Plugin to run another then exit
« Reply #1 on: October 08, 2015, 08:35:31 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 6939
I would like to have one plugin run/call another plugin,
It is not a good idea for general plugins like application plugins, we never use it on such cases.
 If you decide to use, you will face difficulties and understand why we do not use  :wink:

It would be better if we know what you are trying to do  :cool:

Still here is support:

*
using %ProjectDir% is not a good idea.....  well I do not know what you are trying to do ....

*

minor:
winbuilder have a begin bug  :medusa:, when you comment out a line that ends with Begin, break Begin word
Code: [Select]
//-- If,true, Begin
-->
Code: [Select]
//-- If,true, Begi-n

+
not in your codes, but also better break end word too
normally one comment out Begin there is also End ;)
Code: [Select]
//End
-->
Code: [Select]
//En-d

*
winbuilder also have exit bug, do not exit between begin - end
(it may look working with small green button, but it can cause some chain failure on builds)
workaround winbuilder bug with a temporary variable, see summary in the end.


*
I guess you are after:
Code: [Select]
Run,%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script
-->
Code: [Select]
Run,"%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script",Process
There is also Exec,
Code: [Select]
Exec,"%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script",Process

Difference is, "Exec," reads [Variables] and [Interface] of target plugin, Run do not.
ps:
Run, --> CMD world --> Call :blabla
Exec, --> CMD world --> start "" /wait ...blabla.cmd

Also there is "Exec," bug which makes "Exec," command very slow compared to "Run," ,
 that is the reason we use exec rarely inside plugins and much prefer very faster Run,



Summary:

Here is potentially wrong code with some fixes:
Code: [Select]
Set,%tExit%,0
If,Not,%SourceArch%,Equal,x64,Begin
  If,ExistFile,"%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script",Begin
    Set,%tExit%,1
    Echo,"Acronis True Image 2014 is for x86 Builds",Warn,,MessageError  //-- Or Question,
    //- echo, Would you like to install 2014 instead
   //-- If,true, Begi-n
   Exec,"%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script",Process
   Else,Begin
   call,Echo,"Acronis True Image 2016 is only for 64-Bit Builds!",Warn,,MessageError,,Exit
  End
End
If,%tExit%,Equal,1,Exit


+**
from your codes, "exit bug" with "exec" or "run" result with more tricks,
 you can workaround "exit bug" with using temporary variable like above,
 but since your goal is run or exec, where target plugin can also exit
  (here using run or exec may behave different on exit, I did not test for now)
    --> "workaround "exit bug" with using temporary variable" -> can still exit between begin end
  Trick is using temporary variable more tricky way.


Code: [Select]
Set,%tExit%,0
Set,%tExitNOx64%,1
If,Not,%SourceArch%,Equal,x64,Begin
  Set,%tExitNOx64%,0
  If,ExistFile,"%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script",Begin
    Set,%tExit%,1
    Echo,"Acronis True Image 2014 is for x86 Builds",Warn,,MessageError  //-- Or Question,
    //- echo, Would you like to install 2014 instead
   //-- If,true, Begi-n
   //Exec,"%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script",Process
  End
End
//--
If,%tExit%,Equal,1,Exec,"%ProjectDir%\Apps\HD Tasks\Imaging\Acronis TrueImage 2014.script",Process
If,%tExit%,Equal,1,Exit
If,%tExitNOx64%,Equal,1,Call,Echo,"Acronis True Image 2016 is only for 64-Bit Builds!",Warn,,MessageError,,Exit

As you see, trick is, make temp variable decisions inside begin ends,
after end, use temp variable to Exec, or run....

*
This is good demonstration of "one of the reason" (bad coding) nobody use winbuilder bugbuilder to create new projects :) ,
 there are too many problematic bugs for a new user to write some plugins that requires things a bit higher than simple ;).
   One need to learn both codes and bugs and workaround of bugs....


******
Still, Have fun, it is still fun to develop plugins for such nice stable projects  :xmas-beer:

:turtle:
« Last Edit: October 08, 2015, 08:47:47 AM by Lancelot »

Re: How to get one Plugin to run another then exit
« Reply #2 on: October 08, 2015, 08:49:22 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 6939
Edit On previous post:
fixed last summary codes with winbuilder bug workaround %tExitNOx64%
+
added winbuilder bug workaround //End ==> //En-d

And this is only begin-end-run-exec bug  :lol:
 There are lots of other bugs, we will feedback when required  :thumbsup:
 :medusa: :medusa: :medusa:

Well, sadly winbuilder programmed by really bad programmers,
 who follow good ideas on internet with bad skills and hidden stupid commercial agendas,
   sadly all we figured out these very late.  :cool:

Well, Life Goes  :lol:

:turtle:
« Last Edit: October 08, 2015, 08:53:07 AM by Lancelot »

Re: How to get one Plugin to run another then exit
« Reply #3 on: October 08, 2015, 09:00:19 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
//- Was not really marking out line but rather more of a question line..

acronis 2015 exits script on x86 builds, because is does not support x86, but acronis 2014 does support x86..

so what I want the figure out if can been done, just for research is.. If acronis 2015 is selected for an x86 build.
Instead of exiting and not installing Acronis at all..

I would like the 2015 x64 plugin to execute the 2014 x86 plugin instead.. then exit out of the 2015 plugin and continue the build..

No need to spend a lot of time here, just thinking out loud, really..

see in dos cmd -
 if x64 selected and if not x86 present just exit
If x64 selected and x86 present ask question
Ask for user input ( yes - no ) 
if yes then run x86
if no then exit

the problem I see with builder is if it refers upwards to another plugin (x86) without continuing downward from x64 - there will be a loop
So would need to run x86 in place of x64 and continue downwards in build..

Not sure I explained it well enough in simple terms I understand

« Last Edit: October 08, 2015, 09:21:33 AM by KYHI »

Re: How to get one Plugin to run another then exit
« Reply #4 on: October 08, 2015, 09:17:47 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 6939
now you can understand why I tried to combine acronis plugins into one single
Acronis TrueImage WinPE
plugin.
or at most 2 plugins ;)
Acronis TrueImage WinPE
Acronis TrueImage WinPE x64
 :lol:
but currently there are 4, and I do not have time to combine them into at least to 2.....


*
for a general end user plugin, some adjustments on 2015 & 2016 plugins required.......

**
I believe For your task:
simple personal plugin is easier,

2 lines on a simple plugin is I guess enough:
Tip: Utils\PC Packed -> e button  simple plugin.

[Process]
If,%SourceArch%,Equal,x64,Exec,.....2016..,Process
If,%SourceArch%,Equal,x86,Exec,.....2015..,Process

ps: 2015 & 2016 plugins disabled (selected false) ;), only simple plugin enabled.

since it is personal plugin, life is easier  :thumbsup:
 you know you provided both files and serials to your personal 2015 - 2016 plugins,
 simple personal plugin do the rest with only 2 lines.  :thumbsup:

 :wink:

Re: How to get one Plugin to run another then exit
« Reply #5 on: October 08, 2015, 09:25:00 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
easy to combine 2015 and 2016 plugins as both 64 only

have already done that by using if statement

Re: How to get one Plugin to run another then exit
« Reply #6 on: October 08, 2015, 09:42:09 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 6939
 :thumbsup:

**
Well I follow you on
Acronis TrueImage Home 2015
Acronis TrueImage Home 2016
plugins  :thumbsup:
ps: They are currently both noted as (x64 Only)...

I only do changes on these plugins with other things than core, small fixes, du buttons, hason_sonha_itt , download link etc.. you know....

Much later like to combine your plugins with
Acronis TrueImage WinPE ==> to be only x64 with 2016 and future releases
Acronis TrueImage WinPE 2015-14-13-12 ==> to be supporting old x86/x64 versions.

well only on my big free time,
 I am very careful before updating anything, I don't like sloppy work on my hobbies,
   but big time required, when I like to play with Acronis plugins for only organising goals,
     I don't use Acronis but I also don't like to spend time on Acronis related things again and again with known fixes :).





***
Till than,
Let us have any update to your
Acronis TrueImage Home 2015
Acronis TrueImage Home 2016
 follow server updates first (mini download button ;)), than make changes, than update on topics.  :smile:
   So I can quickly check (only check codes for known things ;) )
       and upload to server quickly so other end user get also updated.  :thumbsup:

ps: We 3 update project servers since years same way written above.  :wink:

See You
:turtle:

 

Powered by EzPortal