Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 24
  1. #1
    Join Date
    Aug 2006
    Posts
    355

    Progress Bar for file.runs?

    Code:
    function Run_CB(Source,Run,Total)
    	local npgress = ((Run/Total) * 100);
    	Progress.SetCurrentPos("Progress1", npgress);
    return true;
    end
    
    Progress.SetCurrentPos("Progress1", 0);
    Progress.SetText("Progress1", "");
    Progress.SetEnabled("Progress1", true);
    Progress.SetVisible("Progress1", true);
    
    aa = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\User\\Program\\1");
    if aa == true then
    Label.SetVisible("Label2", true);
    File.Run("AutoPlay\\Docs\\Program\\1.exe", "/s", "", SW_SHOWNORMAL, true, Run_CB);
    Label.SetVisible("Label2", false);
    end
    
    aaa = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\User\\Program\\2");
    if aaa == true then
    Label.SetVisible("Label2", true);
    File.Run("AutoPlay\\Docs\\Program\\2.exe", "/s", "", SW_SHOWNORMAL, true, Run_CB);
    Label.SetVisible("Label2", false);
    end
    
    Progress.SetVisible("Progress1", true);
    Progress.SetCurrentPos("Progress1", 0);
    Progress.SetText("Progress1", "");
    Not work

    solution please?!? or other example please!!

    and added text %? ej: 1%, 2%, etc...??

    thx
    Last edited by Solmos; 11-18-2006 at 06:02 AM.

  2. #2
    Join Date
    Aug 2006
    Posts
    355
    please help!!!

    thx!!!

  3. #3
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    I don't think the File.Run action has a callback function.

  4. #4
    Join Date
    Nov 2006
    Posts
    306
    Hey guys,

    as the File.Run has no return value, it isnt possible to set current position, cause u dont know the amount of time when its ready to run.
    So you are not able to put text in the progressbar refered to the non existing return value.
    You could put text by refering the time your system will use to show that file (run and show). You must remember not all systems open the same amount of time comparing to eachother. So if you system takes 5 seconds to show that file, u can set for every second 20% in your progressbar.

    -Kind Regards,
    Casper

  5. #5
    Join Date
    Aug 2006
    Posts
    355
    Quote Originally Posted by usernameCasper View Post
    Hey guys,

    as the File.Run has no return value, it isnt possible to set current position, cause u dont know the amount of time when its ready to run.
    So you are not able to put text in the progressbar refered to the non existing return value.
    You could put text by refering the time your system will use to show that file (run and show). You must remember not all systems open the same amount of time comparing to eachother. So if you system takes 5 seconds to show that file, u can set for every second 20% in your progressbar.

    -Kind Regards,
    Casper
    one example please!!?

    thx

  6. #6
    Join Date
    Nov 2006
    Posts
    306
    there are 2 simple ways to do this:
    First is to give your button the following statement: Page.StartTimer(500);
    Go to the page where the progressbar is set, then go to the scriptscreen of that page, go to the tab On Timer.
    Here you can put in your preferences. The interval for Refresh the page is set to 0,5 seconds.
    Than use the Progress statements.
    getProgressCurrentPosition, etc.
    For filling in text into the progesbar based on position, you can use this:
    Code:
    percentComplete = ((currentPos - range.Begin) / (range.End - range.Begin)) * 100;
    Progress.SetText("MyProgressBar", percentComplete .. "%");
    Remember that the page refreshtime is 0,5 seconds.
    So its handy to use this in mind, currentPos = currentPos + 10;
    this will use the currentPosition of the progressbar (0) plus 10 for the first refresh. second will be: 10 + 10 = 20 (position of range).
    I refere you to use the statements in Progress. for the avaible settings, such as SetPos,GetPos,SetRange,SetText, etc.
    And dont forget to stop the timer when it reach 100%, so when it reach you last SetRange of you progressbar !! You dont want to set it in a loop and see the text in your progressbar after 1 hour !!
    So use the if-else statement.

    Or use the Progress.StepSize and Progress.StepIt statement

    Hope this will help you out

    Kind Regards,
    Casper

  7. #7
    Join Date
    Nov 2006
    Posts
    306
    If some1 have a better idea, post them please
    A program who is already builded, like *.exe files, most time they wont give you a value (a value to a third partity program) but maybe the value is builded in the exe itself.
    Or you decompile it, thats illegal !! So forget get value from exe (in most cases). As I work for the goverment, I can advise you dont try or search for decompilers.

    Sincerely,
    Casper

  8. #8
    Join Date
    Aug 2006
    Posts
    355
    First, pardon by my English, but is that I do not speak English.


    Thank you very much by the answer yet to usernameCasper, can put to me an example complete scrip that it would have to put (I am very inexperienced with the Autoplay).

    Ah! another thing, I tapeworm another idea, but not if it is possible to be done. The idea is that whenever is finished installing an application, the percentage raises, for example if I have selected that settles 3 applications, when finishing installing first that the progress bar shows a 33%, when it finishes installing second, that shows a 66% etc…

    But this also tendria that to be applied in but cases, like for example if I select 20 applications… when finishing installing first mostrar� a 5%, etc…

    thank you very much by its aid!

    (the translated text this by means of google)

  9. #9
    Join Date
    Nov 2006
    Posts
    306
    Hey Solmos
    Glad to help you !
    ghehe i like the google translations, its not that bad
    I prefer this one: http://www.worldlingo.com/en/product...ranslator.html
    most languages are displayed
    If im home, i can give you the code, its hard to give you the code from out of my head, as im pretty new to the language from AMS

    For putting text on progressbar after closing an application you installed is very simple.
    Use the File-statement, i think its File.Open or File.Run, give the File-statement a "name" (cause it gains a returnvalue) and set the last attribute, a boolean to true, this will give the "name" a value giving you the possibility to set other functions.
    Like this: If "name.boolean = true" then
    'performAction' etc. Progress.SetText("progressbar","33%");
    else if name1.boolean = true; then ...... etc.
    By installing 3 apps in a row, meaning 3 apps will automatically installed you can use macro's / scripting from C++. I don't know if AMS supports this, but Borland C++ does, I think its best for you, you start with AMS. If you are more experienced try other languages as u wish, but AMS owns many languages as i can say

    Good luck with coding
    -Casper

  10. #10
    Join Date
    Aug 2006
    Posts
    355
    Thanks again for its aid, but it can put scrip to me complete? (I not to become scrips…)

    In which it comments to put the text, serious single if 3 programs settled, but and if I select 20 programs? everything in he himself scrip.

    thanks

  11. #11
    Join Date
    Nov 2006
    Posts
    306
    Hey Solmos,

    If you use more, than you can set the number of files to be done.
    the range of you progressbar is 200 for example.
    so 200/20 = 10 steps for each file.
    its very easy !
    try coding / scripting with the statements in my previous posts, only try and you will learn what these attributes do. If you dont know why its not working or giving errors, post them and i will help you out !

    Sincerely,
    Casper

  12. #12
    Join Date
    Aug 2006
    Posts
    355
    thanks but I am very lost,

    as I begin scrip?

  13. #13
    Join Date
    Nov 2006
    Posts
    306
    Use the helpfile in AMS regularly and you can code within 10 days !
    Hope this will work for beginning scripting, or just read the manual they provided !

  14. #14
    Join Date
    Aug 2006
    Posts
    355
    Code:
    Progress.SetCurrentPos("Progress1", 0);
    Progress.SetEnabled("Progress1", true);
    Progress.SetVisible("Progress1", true);
    Progress.SetText("Progress1","0%");
    
    aa = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\user\\1");
    if aa == true then
    File.Run("AutoPlay\\Docs\\Programs\\1.exe", "/s", "", SW_SHOWNORMAL, true);
    end
    Progress.SetText("Progress1","33%");
    Progress.SetCurrentPos("Progress1", 33);
    
    aaa = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\user\\2");
    if aaa == true then
    File.Run("AutoPlay\\Docs\\Programs\\2.exe", "/s","", SW_SHOWNORMAL, true);
    end
    Progress.SetText("Progress1","66%");
    Progress.SetCurrentPos("Progress1", 66);
    
    etc 
    
    Progress.SetVisible("Progress1", true);
    Progress.SetCurrentPos("Progress1", 100);
    Progress.SetText("Progress1", "100%");
    As I can put that it marks “%” according to I number of selected programs?

    for example, if I select 5… when installing first that it shows 20%, when installing second 40%, etc

    But I select 30 programs… that when installing first it shows 3%,etc…

    please, help me to do scrip

    thanks

  15. #15
    Join Date
    Nov 2006
    Posts
    306
    it could be like that, but why making more code as it can done with less code?
    Example, what i posted be4 in this post:

    Code:
    percentComplete = ((currentPos - range.Begin) / (range.End - range.Begin)) * 100;
    Progress.SetText("MyProgressBar", percentComplete .. "%");

Page 1 of 2 1 2 LastLast

Similar Threads

  1. FTP Plugin and Progress Bar
    By Roboblue in forum AutoPlay Media Studio 6.0
    Replies: 4
    Last Post: 03-27-2006, 03:55 AM
  2. Web Browser Progress Bar
    By craigedmonds in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 12-07-2005, 03:59 PM
  3. Tutorial request for flash progress bar.
    By 4thstar in forum AutoPlay Media Studio 6.0
    Replies: 17
    Last Post: 12-06-2005, 11:44 AM
  4. Progress bar while executing batch file
    By StealthShadow in forum Setup Factory 7.0
    Replies: 3
    Last Post: 10-25-2005, 09:59 PM
  5. Progress Bar...
    By tealmad in forum Setup Factory 7.0
    Replies: 14
    Last Post: 02-05-2005, 12:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts