Hi, I have downloaded the Trial version (again) of AutoPlay Media Studio and am thinking about buying it.
After many hours looking at this forum and using the Help files, I have finally started to create a script which I am having trouble with the "Callback" function for the "File.Copy" option.
Here is the coding I am using:
I have got the Callback function working (in a way). The only thing is that it wont display the process in either the "Progress Display" nor the Progress Bar...
Can anyone help?
After many hours looking at this forum and using the Help files, I have finally started to create a script which I am having trouble with the "Callback" function for the "File.Copy" option.
Here is the coding I am using:
Code:
continue = Dialog.Message("", "This will detect what \"Operating System\" you are running and load up the correct Media Player\r\nClick OK to continue", MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1) if continue == IDOK then os_name = System.GetOSName() My_Docs = Shell.GetFolder(SHF_MYDOCUMENTS) function CopyFileDialog(Filename, nPercent) StatusDlg.SetTitle("Copying File...") StatusDlg.SetMessage("Please Wait....\r\nNow copying \"Windows Media Player\" onto your system\r\nYou can cancel at anytime") StatusDlg.SetStatusText("Copied "..nPercent.."%") StatusDlg.SetMeterRange(0, 100) StatusDlg.SetMeterPos(nPercent) StatusDlg.ShowCancelButton(true, "Cancel Copying") local cancelled = StatusDlg.IsCancelled() if cancelled then StatusDlg.Hide() return false else return true end end if os_name == "Windows XP" then copy_installation = Dialog.Message("", "Do you wish to copy the Installation for \"Windows Media Player 10\" into a folder of your choosing", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) if copy_installation == IDYES then copy_file = Dialog.FileBrowse(false, "Select Location...", My_Docs, "Installation File (*.exe)|*.exe|", "Media Player 10", "", false, false) if copy_file[1] ~= "CANCEL" then if copy_file ~= "" or copy_file ~= " " then StatusDlg.Show() File.Copy("mp10setup.exe", copy_file[1], false, false, true, true, CopyFileDialog) StatusDlg.Hide() Dialog.Message("Copy Completed", "File copied successfully") run_file = Dialog.Message("Run Installation?", "Do you wish to run the installation now?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) if run_file == IDYES then File.Run(copy_file[1], "", "", SW_SHOWNORMAL, false) end end end else File.Run("mp10setup.exe", "", "", SW_SHOWNORMAL, false) end else copy_installation = Dialog.Message("", "Do you wish to copy the Installation for \"Windows Media Player 9\" into a folder of your choosing", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) if copy_installation == IDYES then copy_file = Dialog.FileBrowse(false, "Select Location...", My_Docs, "Installation File (*.exe)|*.exe|", "Media Player 9", "", false, false) if copy_file[1] ~= "CANCEL" then if copy_file ~= "" or copy_file ~= " " then StatusDlg.Show() File.Copy("MPSetup.exe", copy_file[1], false, false, true, true, CopyFileDialog) StatusDlg.Hide() Dialog.Message("Copy Completed", "File copied successfully") run_file = Dialog.Message("Run Installation?", "Do you wish to run the installation now?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) if run_file == IDYES then File.Run(copy_file[1], "", "", SW_SHOWNORMAL, false) end end end else File.Run("MPSetup.exe", "", "", SW_SHOWNORMAL, false) end end end Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE)
Can anyone help?
Comment