ultimatepp/uppsrc/ide/Install.cpp
klugier 7eac3c453f Ide: Improve POSIX installation process - now when SVN is not installed local sources is configure by default.
git-svn-id: svn://ultimatepp.org/upp/trunk@11954 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2018-05-19 21:06:53 +00:00

62 lines
1.3 KiB
C++

#include "ide.h"
//#include "Install.h"
#ifndef PLATFORM_WIN32
bool CopyFolder(Progress& pi, const char *dst, const char *src)
{
return CopyFolder(dst, src, &pi);
}
void ChkSupp(const char *s, String& dir)
{
if(IsNull(dir) && FileExists(AppendFileName(s, "GCC.bm")))
dir = s;
}
String DefaultInstallFolder()
{
String DefaultFolder;
String ExeTitle = ToUpper(GetExeTitle());
for(int i = 0; i < ExeTitle.GetCount(); i++) {
if(ExeTitle[i] >= 'a' && ExeTitle[i] <= 'z')
ExeTitle.Set(i, ExeTitle[i] + 'A'-'a');
}
if(ExeTitle.Find("SVN") >= 0)
DefaultFolder = "upp-svn";
else if(ExeTitle.Find("DEV") >= 0)
DefaultFolder = "upp-dev";
else if(ExeTitle.Find("BETA") >= 0)
DefaultFolder = "upp-beta";
else
DefaultFolder = "upp";
return DefaultFolder;
}
bool Install()
{
int status = InstallWizard().Run();
if (status == IDCANCEL) {
return false;
}
String supp = UpdaterCfg().globalsrc;
FindFile ff(ConfigFile("*.bm"));
if(!ff) {
ff.Search(AppendFileName(supp, "*.bm"));
while(ff) {
FileCopy(ff.GetPath(), ConfigFile(ff.GetName()));
ff.Next();
}
}
// 2008/06/01 -- add valgrind suppression file
String ValgSupp = ConfigFile("valgrind.supp");
if(IsNull(LoadFile(ValgSupp)))
SaveFile(ValgSupp, LoadFile(AppendFileName(supp, "uppsrc/ide/valgrind.supp")));
// 2008/06/01 -- END
return true;
}
#endif