Jump to content

Delphi UPX Help

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
KenTheFurry

KenTheFurry

    Newbie

  • Members
  • Pip
  • 4 posts
Hi I need some help making a GUI for a program called UPX. UPX is a packer for executable programs. I use it to help stop people from stealing my source... But anyway i can make it select the program and pack it but i am trying to make a log file that will post into a memo box... I have a bat file that has this code...

@Echo off

upx -9 %1% >log.txt

exit

but when i click on my pack button it will make the log.txt in the folder where the exe i am trying to pack is at...
i just used the code...

ShellExecute(Handle,"open",'upx.bat',PANsichar(edit1.text),nil,SW_HIDE);

memo1.lines.loadfromfile("log.txt");

Well i hope that i was clear enough.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Where are you having the issue?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
KenTheFurry

KenTheFurry

    Newbie

  • Members
  • Pip
  • 4 posts
Well it will make the log file but i have it so once it is dont packing the file it will open a log file in the memo box but it is looking for a file in the projects folder where i have the .exe at and i just get an error saying that it could not find the file.

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
It sounds like it expects the file to already exist. You should be able to create a blank file easily like this:
function resetfile()
var
  oFile : TextFile;
begin
  AssignFile(oFile,'log.txt');
  ReWrite(oFile);
  CloseFile(oFile);
end;

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
KenTheFurry

KenTheFurry

    Newbie

  • Members
  • Pip
  • 4 posts
The log file does get created...

@Echo off

upx -9 %1% >log.txt

exit

i put that into a batch file witch i converted to a exe so when you are in delphi and you do the code...

ShellExecute(Handle,"open",'upx.exe',PANsichar(edit1.text),nil,SW_HIDE);

The edit1.text is the text box that holds the file pathway and name example (C:\bob.exe)
the exe i made from the batch will make the .log in the same folder as the exe you are packing so if you selected the file bob2.exe in the folder C:\topack\ it will make the log file in the C:\topack folder...
But the memo1.lines.loadfromfile("log.txt"); is looking for the file in the same folder as the project .exe is or the UPX Gui.

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
There is probably a path name specified someplace, instead of just a file name.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#7
KenTheFurry

KenTheFurry

    Newbie

  • Members
  • Pip
  • 4 posts
Well then how do you call that so it will open the log file?