Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- title EXE Press
- #added to allow for Run Script from within editor.
- if %1
- if @equal(@ext(%1),sns)
- shift
- end
- end
- ##################################################
- if @not(@file(@path(%0)upx.exe))
- warn upx.exe not found.
- stop
- end
- %%ver = 2.0.0.0
- option fieldsep,"."
- dialog CREATE,EXE Press v%%ver,-1,0,443,284,CLASS actpak,DRAGDROP,color white
- rem *** Modified by Dialog Designer on 5/6/2008 - 13:45 ***
- dialog ADD,EXTTEXT,EXTTEXT1,2,7,168,17,Browse for file or <b>drag -n- drop</b>
- dialog ADD,EDIT,EDIT1,19,9,352,19
- dialog ADD,BUTTON,Browse,16,366,64,24,Browse
- dialog ADD,GROUP,GROUP1,99,10,427,177,Output
- #dialog ADD,EDIT,out,120,18,394,147,,,MULTI,WRAP,SCROLL,readonly
- dialog ADD,TEXT,out,120,18,409,147
- dialog ADD,TRACKBAR,Level,44,143,136,26,1|9|1,5,,LEFT
- dialog ADD,TEXT,TEXT2,53,12,,,Compression Level: MIN
- dialog ADD,BUTTON,compress,50,303,60,24,Compress
- dialog ADD,BUTTON,decompress,50,366,72,24,DeCompress
- dialog ADD,CHECK,bak,77,13,119,18,Create Backup File
- dialog ADD,TEXT,MAX,55,278,,,MAX
- #if %%exe
- # DIALOG ADD,BUTTON,cmu,79,199,158,24,Remove from EXE context menu
- #else
- # DIALOG ADD,BUTTON,cmu,79,199,148,24,Add to EXE context menu
- #end
- dialog SHOW
- if %1
- dialog set,Edit1,%1
- dialog set,level,9
- goto CompressButton
- end
- if @winexists(#TMainWin)
- %t = @wintext(#TMainWin)
- %p = @pos(":",%t)
- %%proj = @trim(@substr(%t,@pred(%p),@len(%t)))
- %p = @path(%%Proj)
- %%in = %p@name(%%Proj)".exe"
- dialog set,edit1,%%in
- dialog set,level,9
- end
- :evloop
- wait event
- goto @event()
- :cmubutton
- %%exe = @regread(ROOT,.exe\shell\Compress,command)
- if %%exe
- registry write,ROOT,.exe\shell\Compress,command
- %%exe =
- else
- registry write,ROOT,.exe\shell\Compress,command,%0
- %%exe = %0
- end
- if %%exe
- dialog set,cmu,Remove from EXE context menu
- else
- dialog set,cmu,Add to EXE context menu
- end
- goto evloop
- :DragDrop
- list create,1
- %l = 1
- list dropfiles,%l
- if @equal(@ext(@item(%l)),EXE)
- dialog set,edit1,@item(%l)
- end
- list close,1
- goto evloop
- :BrowseButton
- %f = @filedlg(*.exe)
- if @ok()
- dialog set,edit1,%f
- end
- goto evloop
- :close
- #file delete,@path(%0)upx.exe
- stop
- :CompressButton
- dialog set,out,"Working, Please wait..."
- %l = @dlgtext(level)
- if @dlgtext(bak)
- %b = -k
- end
- runh @path(%0)\upx.exe -%l %b @chr(34)@dlgtext(edit1)@chr(34),pipe
- list create,1
- %t = 1
- list assign,%t,@pipe()
- list seek,%t,0
- %x = 0
- repeat
- list delete,%t
- %x = @succ(%x)
- until @equal(%x,4)
- list insert,%t
- #dialog set,out,@pipe()
- dialog set,out,@text(%t)
- list close,%t
- goto evloop
- :Compress
- dialog set,out,"Working, Please wait..."
- %l = @dlgtext(level)
- if @dlgtext(bak)
- %b = -k
- end
- runh @path(%0)\upx.exe -%l %b @chr(34)@dlgtext(edit1)@chr(34),pipe
- list create,1
- list assign,%t,@pipe()
- list seek,%t,0
- %x = 0
- repeat
- list delete,%t
- %x = @succ(%x)
- until @equal(%x,4)
- list insert,%t
- #dialog set,out,@pipe()
- dialog set,out,@text(%t)
- list close,%t
- stop
- :DecompressButton
- dialog set,out,"Working, Please wait..."
- runh @path(%0)\upx.exe -d @chr(34)@dlgtext(edit1)@chr(34),pipe
- list create,1
- %t = 1
- list assign,%t,@pipe()
- list seek,%t,0
- %x = 0
- repeat
- list delete,%t
- %x = @succ(%x)
- until @equal(%x,4)
- list insert,%t
- #dialog set,out,@pipe()
- dialog set,out,@text(%t)
- list close,%t
- goto evloop
Advertisement
Add Comment
Please, Sign In to add comment