-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.ps1
69 lines (51 loc) · 1.68 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Assumes you have 7zip (7z.exe) in your path
# to build the final zip file. Otherwise you can
# manually zip uo the contents of the build folder
# Change this manually if necessary ("c:\webconnectionprojects\myproject\")
$curDir = "$PSScriptRoot"
cd $curDir
# Your Web Connection Install Path
$src="C:\WEBCONNECTION\FOX"
# The Project Path
$tgt=$curDir
$appname="wwThreads"
# Remove the Build folder
if ( Test-Path "$tgt\build" -PathType Container ) {
remove-item $tgt\build -force -recurse
}
# force to current path even when running as Admin
mkdir $tgt\build
mkdir $tgt\build\deploy
cd $tgt\build\deploy
# copy EXE and config file and IIS Install
Copy-Item $tgt\deploy\$appname.exe
Copy-Item $tgt\deploy\$appname.ini
Copy-Item $tgt\deploy\config.fpw
Copy-Item $tgt\install-iis-features.ps1
# copy Web Connection DLLs from WWWC install
Copy-Item $src\*.dll
# change back to build folder
cd $tgt\build
# Copy data and Web Folders
# Comment if you don't want to package those
robocopy $tgt\data .\data /MIR
robocopy $tgt\web .\web /MIR
robocopy $tgt\WebConnectionWebServer WebConnectionWebServer /MIR
# Deployed apps shouldn't have prg/fxp files
# Let them re-compile on the server
Remove-Item -force -recurse $curDir\web\*.bak
Remove-Item -force -recurse $curDir\web\*.fxp
Remove-Item -force -recurse $curDir\web\*.prg
Write-Host $appname
$zipfile = "$tgt\build\$appname" + "_Packaged.zip"
Write-Host $zipfile
if (Get-Command "7z.exe" -ErrorAction SilentlyContinue)
{
# add 7zip to your path or in this folder for this to work
& 7z a -r $zipfile "*.*"
}
else
{
Write-Host "7z.exe - 7zip is not available. No zip file file was created." -ForegroundColor Yellow
}
cd $curdir