PDA

View Full Version : BUG: Dialog.FileBrowse


LetsRideBaby
08-17-2009, 04:54 PM
Check this post for the info
http://www.indigorose.com/forums/showpost.php?p=142334&postcount=10

and the project is below and a test apps you can try to install it and see that the list cant be be update no more till you close and reopen the project..

Unzip the Test App.zip the file to pick to install app is Test App.lpa

Darryl
08-24-2009, 08:45 AM
I believe your problem may just be a scripting error in your function "ShowListOfApps" in Global Functions. Take a closer look at that function's contents, in particular the placement of your "end" statements, and where your "ListBox.SetUpdate(LB, true)" action is located.

I first tried commenting out the SetUpdate actions and it worked. I then uncommented them and adjusted its location and "end" statements, and it seemed to work.

So make another pass through that function to make sure your "end"s are where you want them.

LetsRideBaby
08-24-2009, 03:21 PM
I have commented out all the SetUpdate for the list box and it still dont work.

After i install the app you can not use the function "ShowListOfApps" even if you stick it at the end of the install buttons on click code..

The list works fine till i install an app and then it dont work now more till i close it all and open it again.

I have even tried to put the list box SetUpdate code on the install so it couldnt update till after the install but it still seems to lock updating the list with the function "ShowListOfApps" even if i just copy this code to a button it wont working till i close and open it after installing an app.

This is the code i use now..

function ShowListOfApps()
--Start show list of apps

-- Thanks to limboo for help with this code to look for the .exe files

LB = "Apps List";


--Disable listbox Updating
--ListBox.SetUpdate(LB, false);

--Set default folder
folder = "AutoPlay\\Docs";

--Set Default Extension
--ListBox.SetEnabled(LB, true);
--ListBox.DeleteItem(LB, -1);

-- tbSearchFiles = {"*.doc", "*.ppt", "*.odt", "*.exe"}; set your own file types here
-- this one search all types
tbSearchFiles = {"*.exe"};

for index,type in tbSearchFiles do
file = File.Find(folder, type, true, false, nil);


if file ~= nil then
--do the following for each file:
for j, k in file do
--add the item to the listbox, with the name visible and path as data
findslash = String.ReverseFind(k, "\\", false);
filename = String.Mid(k, findslash+1, -1);
subfolder = String.Replace(k, folder, "", false);
slash = 0
--delete the first slash because it is not needed for the counting
subfolder = String.Right(subfolder, String.ToNumber(String.Length(subfolder))-1);
firstslash = String.Find(subfolder, "\\", false);
if firstslash ~= -1 then
slash = 1
afterfirstslash = String.Mid(subfolder, firstslash+1, -1);
secondslash = String.Find(afterfirstslash, "\\", false);
if secondslash ~= -1 then
slash = 2
aftersecondslash = String.Mid(afterfirstslash, secondslash+1, -1);
thirdslash = String.Find(aftersecondslash, "\\", false);
if thirdslash ~= -1 then
slash = 3
end
end
end

if slash <= 2 then
--take the file name and remove the .exe
remove_exe = String.Replace(filename, ".exe", "", false);
--Show the file name in the list box without the .exe
ListBox.AddItem(LB, remove_exe, k);

end
end
end
end

--Allow the listbox to display the updated content
--ListBox.SetUpdate(LB, true);

end

-- end show list of apps

Darryl
08-25-2009, 08:19 AM
Maybe I'm not understanding what the problem is, or haven't performed the right steps, but here were my findings on a test system with Windows XP SP2:

- I opened your initial project.
- I replaced your global functions with the latest that you posted as a test.
- I published the project to the hard drive.
- I moved the published files to a test system in a subfolder of C:
- I manually created the \AutoPlay\Docs\Portable Software folder, because it seemed it needed it's existence to work.
- I then ran the autorun.exe, browsed for your test file "Test App.lpa" which I put in the same location as the autorun.exe.
- I clicked the "Install Apps" button which successfully did the extraction.
- I then clicked the "Reload List" button which displayed "Test Apps LRB" in the list box which I thought was the problem. Since you removed the clearing of the listbox etc as a test, every time I clicked it, it added another item to the list as expected.

So based on my steps, am I doing something wrong to replicate the problem? What operating system are you testing on, maybe that is a factor?

LetsRideBaby
08-25-2009, 01:58 PM
Maybe I'm not understanding what the problem is, or haven't performed the right steps, but here were my findings on a test system with Windows XP SP2:

- I opened your initial project.
- I replaced your global functions with the latest that you posted as a test.
- I published the project to the hard drive.
- I moved the published files to a test system in a subfolder of C:
- I manually created the \AutoPlay\Docs\Portable Software folder, because it seemed it needed it's existence to work.
- I then ran the autorun.exe, browsed for your test file "Test App.lpa" which I put in the same location as the autorun.exe.
- I clicked the "Install Apps" button which successfully did the extraction.
- I then clicked the "Reload List" button which displayed "Test Apps LRB" in the list box which I thought was the problem. Since you removed the clearing of the listbox etc as a test, every time I clicked it, it added another item to the list as expected.

So based on my steps, am I doing something wrong to replicate the problem? What operating system are you testing on, maybe that is a factor?



Ok i got it to work but only if this Test App.lpa is in the same folder as the autorun.exe and then it will update the list..

But it wont let me install one from the desktop why is this?