factor/basis/tools/deploy/windows/windows.factor

34 lines
1.1 KiB
Factor
Raw Normal View History

! Copyright (C) 2007, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: io io.files io.pathnames io.directories io.encodings.ascii kernel namespaces
sequences locals system splitting tools.deploy.backend
tools.deploy.config tools.deploy.config.editor assocs hashtables
prettyprint combinators windows.shell32 windows.user32 ;
IN: tools.deploy.windows
: copy-dll ( bundle-name -- )
"resource:factor.dll" swap copy-file-into ;
:: copy-vm ( executable bundle-name extension -- vm )
vm "." split1-last drop extension append
bundle-name executable ".exe" append append-path
[ copy-file ] keep ;
: create-exe-dir ( vocab bundle-name -- vm )
2008-11-09 18:27:51 -05:00
dup copy-dll
deploy-ui? get ".exe" ".com" ? copy-vm ;
2008-04-02 20:46:37 -04:00
M: winnt deploy*
2008-05-10 16:22:38 -04:00
"resource:" [
2008-11-09 18:27:51 -05:00
dup deploy-config [
deploy-name get
{
2008-05-10 16:22:38 -04:00
[ create-exe-dir ]
[ image-name ]
[ drop namespace make-deploy-image ]
[ nip "" copy-resources ]
[ nip open-in-explorer ]
} 2cleave
2008-11-09 18:27:51 -05:00
] bind
] with-directory ;