My favorites
▼
|
Sign in
upp-mirror
U++ is the C++ development platform
Project Home
Downloads
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
uppbox
/
MakeInstall4
/
Main.cpp
‹r4488
r5017
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#include <Core/Core.h>
#include <plugin/bz2/bz2.h>
using namespace Upp;
void Log(const char *txt)
{
Cout() << txt << "\r\n";
}
void Error(const char *e)
{
Log(e);
abort();
}
String Syx(const char *s)
{
Log(s);
String r;
int q = Sys(s, r);
if(q)
Error(String().Cat() << "Failed: " << s << "\r\n" <<
"Exit code: " << q << "\r\n" <<
"Output: " << r);
return r;
}
void CopyFolder(const char *src, const char *dst, bool deep = true)
{
Cout() << Sprintf("Directory %s\n", src);
RealizeDirectory(dst);
FindFile ff(String(src) + "/*.*");
while(ff) {
String s = AppendFileName(src, ff.GetName());
String d = AppendFileName(dst, ff.GetName());
if(ff.IsFile()) {
String q = LoadFile(s);
String ext = ToLower(GetFileExt(s));
if(ext != ".aux" && ext != ".$old")
SaveFile(d, q);
}
else
if(ff.IsFolder() && *ff.GetName() != '.') {
if(deep || *GetFileExt(s))
CopyFolder(s, d, deep);
}
ff.Next();
}
}
int CrLfSm(int c)
{
return c == ';' || c == '\r' || c == '\n';
}
void CopyFolders(const char *src, const char *dst, const char *folders, bool deep = true)
{
Vector<String> folder = Split(LoadFile(folders), CrLfSm);
for(int i = 0; i < folder.GetCount(); i++)
CopyFolder(AppendFileName(src, folder[i]), AppendFileName(dst, folder[i]), deep);
}
String tmp = "u:/upp.tmp";
String upptmp = tmp + "/u";
String ass = upptmp + "/uppsrc";
String upp = "u:/upp.src";
String uppsrc = upp + "/uppsrc";
String win32 = "u:/theide";
void CopyIdeFile(const String& fn)
{
SaveFile(upptmp + '/' + fn, LoadFile(win32 + '/' + fn));
}
int NoDigit(int c) { return IsDigit(c) ? 0 : c; }
int FilterVersion(int c) { return c == ':' ? '_' : c; }
void Make(String pkg, String exe)
{
Syx(win32 + "/umk " + ass + " " + pkg + " " + win32 + "/MSC9.bm -ar " + upptmp + "/" + exe);
}
CONSOLE_APP_MAIN
{
if(FileExists("u:/upp/umk.exe"))
win32 = "u:/upp";
else
win32 = "u:/Win32/theide";
Vector<String> s = Split(Syx("svnversion " + upp), NoDigit);
if(s.GetCount() == 0)
Error("Invalid version");
String version = s.Top();
Log("version: " + version);
DeleteFolderDeep(tmp);
RealizeDirectory(tmp);
CopyFolders(uppsrc, ass, uppsrc + "/packages");
CopyFolders(uppsrc, ass, uppsrc + "/packages1", false);
CopyFolders(upp, upptmp, uppsrc + "/assemblies");
SaveFile(upptmp + "/uppsrc/guiplatform.h", "");
SaveFile(upptmp + "/uppsrc/uppconfig.h", LoadFile(uppsrc + "/uppconfig"));
SaveFile(upptmp + "/uppsrc/ide/version.h", "#define IDE_VERSION \"" + version + "\"\r\n");
Make("ide", "theide.exe");
Make("umk", "umk.exe");
CopyIdeFile("dbghelp.dll");
CopyIdeFile("en-us.scd");
CopyIdeFile("en-gb.scd");
SetCurrentDirectory(upptmp);
SaveFile("install.upp", LoadFile(uppsrc + "/install.upp"));
SaveFile("license.chk", "1");
Syx(win32 + "/7za/7za.exe a " + tmp + "/upp.7z * -r -mx -m0fb=255 -mf=off");
SetCurrentDirectory(tmp);
Syx(win32 + "/umk " + upp + "/uppbox," + upp + "/uppsrc WinInstaller2 " + win32 +
"/MSC9 -ar u:/upload/upp-win32-" + Filter(version, FilterVersion) + ".exe");
}
Show details
Hide details
Change log
r4856
by cxl on Apr 25, 2012
Diff
.MakeInstall4: fixed for uppconfig.h
Go to:
/trunk/uppbox/MakeInstall4/Main.cpp
Project members,
sign in
to write a code review
Older revisions
r4488
by cxl on Jan 29, 2012
Diff
.uppbox
r4487
by cxl on Jan 29, 2012
Diff
.uppbox
r4486
by cxl on Jan 29, 2012
Diff
.uppbox
All revisions of this file
File info
Size: 3060 bytes, 122 lines
View raw file
Powered by
Google Project Hosting