* ini.h: Declare extern SetupBaseName, SetupArch and SetupIniDir.
Redefine macros to use them.
* main.cc: Provide option "-i/--ini-basename" to set the basename
for setup, keep the default as "setup" and store in SetupBaseName.
Initialize SetupArch and SetupIniDir based on effective
architecture.
+2015-07-01 Achim Gratz <Stromeko@NexGo.DE>
+
+ * ini.h: Declare extern SetupBaseName, SetupArch and SetupIniDir.
+ Redefine macros to use them.
+
+ * main.cc: Provide option "-i/--ini-basename" to set the basename
+ for setup, keep the default as "setup" and store in SetupBaseName.
+ Initialize SetupArch and SetupIniDir based on effective
+ architecture.
+
2015-06-11 Achim Gratz <Stromeko@NexGo.DE>
* inilex.ll: Increase read buffer size for the lexer input buffer
class io_stream;
#include <string>
+#include <vector>
+
+typedef std::vector <std::string> IniList;
+extern IniList found_ini_list, setup_ext_list;
+const std::string setup_exts[] = { "xz", "bz2", "ini" };
+extern bool is_64bit;
+extern std::string SetupArch;
+extern std::string SetupIniDir;
+extern std::string SetupBaseName;
+
class IniState;
class IniDBBuilder;
class IniParseFeedback;
EXCLUDE_NOT_FOUND
} excludes;
-extern bool is_64bit;
-#define SETUP_INI_DIR (is_64bit ? "x86_64/" : "x86/")
-#define SETUP_INI_FILENAME "setup.ini"
-#define SETUP_BZ2_FILENAME "setup.bz2"
+#define SETUP_INI_DIR (SetupIniDir.c_str ())
+#define SETUP_INI_FILENAME ((SetupBaseName+".ini").c_str ())
+#define SETUP_BZ2_FILENAME ((SetupBaseName+".bz2").c_str ())
/* The following three vars are used to facilitate error handling between the
parser/lexer and its callers, namely ini.cc:do_remote_ini() and
#endif
bool is_64bit;
+std::string SetupArch;
+std::string SetupIniDir;
using namespace std;
static BoolOption NoAdminOption (false, 'B', "no-admin", "Do not check for and enforce running as Administrator");
static BoolOption WaitOption (false, 'W', "wait", "When elevating, wait for elevated child process");
static BoolOption HelpOption (false, 'h', "help", "print help");
+static StringOption SetupBaseNameOpt ("setup", 'i', "ini-basename", "Use a different basename, e.g. \"foo\", instead of \"setup\"", false);
+std::string SetupBaseName;
static void inline
set_cout ()
if (unattended_mode || help_option)
set_cout ();
+ SetupBaseName = SetupBaseNameOpt;
+ SetupArch = is_64bit ? "x86_64" : "x86";
+ SetupIniDir = SetupArch+"/";
+
/* Get System info */
OSVERSIONINFO version;
version.dwOSVersionInfoSize = sizeof version;