View Full Version : Question
banon
11-18-2006, 06:16 PM
I have a problem with creating a web/e-mail exe file. i put whole folder in autoplay's "docs" folder and when i try to run it by pressing the button it shows an error. it's because when it runs the program doesnt copy everything from the "docs" folder, but only one executable that is linked to the button (when preview it everything works fine). can i somehow force it to unpack every single file to a temp folder and then run the executable? plz help
yosik
11-19-2006, 12:01 AM
Why would you need to copy anything from your Docs folder to the HD? Why can't you run from the folder itself (thus using relative paths)?
Yossi
banon
11-19-2006, 02:19 AM
i work in a company where everything is blocked (dvd's/usb's, no admin rights etc). i can't install anything, so i need to make a "portable" version of every program to make it run. that's why i need to make it unpack whole thing and then run it. of course i can add "explore folder" function and then copy whole thing to hdd and make it run without probs (and i did so), but it's kinda lame (because i know there must be a way to make autoplay do it for me:)
yosik
11-19-2006, 02:32 AM
But that is EXACTLY what I meant.
Don't install anything, just run your website from the AMS project.
Yossi
banon
11-19-2006, 04:23 AM
Ok so i searched the forums and now i have an app that extracts itself to a temp folder and then runs. it works fine for a little proggies, but when there's much more files it tries to run it before copying to a folder is finished.
function CopyFolder(sSource, sDestination)
local m_sFolder;
local m_FoundFolder;
local error;
--Find all the folders and sub-Folders
--results are stored in the table m_tblFolders
m_tblFolders = Folder.Find(sSource, "*", true, nil);
--if our destination folder does not have the
--backslash as the last character, add it
if String.Right(sDestination, 1) ~= "\\" then
sDestination = sDestination .. "\\";
end
--m_tblFolders will be nil if there are no folders
if m_tblFolders ~= nil then
--enumerate through the found folders
for n, m_FoundFolder in m_tblFolders do
--replace the source's path with the destination's path
m_sFolder = String.Replace(m_FoundFolder, sSource, sDestination, false);
--create the folder
Folder.Create(m_sFolder);
error = Application.GetLastError();
if (error ~= 0) then
--set n to value to exit FOR loop
n = Table.Count(m_tblFolders)
end
end
end
--if no errors occurred, copy the files
if (error == 0) then
--show the status dialog
StatusDlg.Show(MB_ICONNONE, false);
--copy all files from the source folder, with recurse.
File.Copy(sSource .. "\\*.*", sDestination, true, true, false, true, nil);
--hide the status dialog
StatusDlg.Hide();
error = Application.GetLastError();
end
--clean up
m_tblFolders = nil;
return error;
end
if CopyFolder("AutoPlay\\Docs\\vp_uml\\", _TempFolder) == 0 then
result = File.Run(_TempFolder.."\\vp_uml\\bin\\Visual Paradigm for UML 5.3.exe", "", _TempFolder , SW_SHOWNORMAL, true);
else
result = Dialog.Message("Folder Copy", "There was an error copying the folder.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end
the question is how to make it wait for the copy process to get finished, and then run the proggie?(Visual Paradigm for UML 5.3)
Roboblue
11-19-2006, 03:44 PM
So, you are building to a web/email exe?
Then it extracts to users temp folder?
As yosik says, build to a hard drive folder, then burn the whole directory structure.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.