- printf("Creating installer...\n");
- append_file("sfx.exe");
- fwrite("DBSOFT-HEADER", 1, 13, installfile);
- while(!feof(cfgfile))
- {
- getline(cfgfile, entry, entrydata);
- if(stricmp(entry, "INSTALLER_APPLICATION") == 0)
- INSTALLER_APPLICATION = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_VERSION") == 0)
- INSTALLER_VERSION = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_TITLE") == 0)
- INSTALLER_TITLE = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_PATH") == 0)
- INSTALLER_PATH = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_FOLDER") == 0)
- INSTALLER_FOLDER = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_PROGRAM") == 0)
- INSTALLER_PROGRAM = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_SHADOW") == 0)
- INSTALLER_SHADOW = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_OBJECT") == 0)
- INSTALLER_OBJECT = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_SETS") == 0)
- INSTALLER_SETS = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_SYSVAR") == 0)
- INSTALLER_SYSVAR = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_SYSLINE") == 0)
- INSTALLER_SYSLINE = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_CONFIRM_WPS") == 0)
- INSTALLER_CONFIRM_WPS = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_CONFIRM_CONFIGSYS") == 0)
- INSTALLER_CONFIRM_CONFIGSYS = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_CONFIRM_OVERWRITE") == 0)
- INSTALLER_CONFIRM_OVERWRITE = (char *)strdup(entrydata);
- if(stricmp(entry, "INSTALLER_PACKAGE") == 0)
- {
- for(z=0;z<strlen(entrydata);z++)
- {
- if(entrydata[z] == ',')
- {
- entrydata[z] = 0;
- packagefilename[INSTALLER_PACKAGE_COUNT] = (char *)strdup(entrydata);
- INSTALLER_PACKAGES[INSTALLER_PACKAGE_COUNT] = (char *)strdup(&entrydata[z+1]);
- }
- }
- resetglobals();
- files=0;
- include_unpack(packagefilename[INSTALLER_PACKAGE_COUNT]);
- packagefiles[INSTALLER_PACKAGE_COUNT] = files;
- INSTALLER_PACKAGE_COUNT++;
- }
- }
- fclose(cfgfile);
- fprintf(installfile, "%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%d",
- INSTALLER_APPLICATION, INSTALLER_VERSION, INSTALLER_TITLE,
- INSTALLER_PATH, INSTALLER_FOLDER, INSTALLER_PROGRAM,
- INSTALLER_SHADOW, INSTALLER_OBJECT, INSTALLER_SETS, INSTALLER_SYSVAR,
- INSTALLER_SYSLINE, INSTALLER_CONFIRM_WPS, INSTALLER_CONFIRM_CONFIGSYS,
- INSTALLER_CONFIRM_OVERWRITE, INSTALLER_PACKAGE_COUNT);
- for(z=0;z<INSTALLER_PACKAGE_COUNT;z++)
- fprintf(installfile, "-%s", INSTALLER_PACKAGES[z]);
- fwrite("*", 1, 1, installfile);
- for(z=0;z<INSTALLER_PACKAGE_COUNT;z++)
- {
- struct stat blah;
-
- stat(packagefilename[z], &blah);
- fprintf(installfile, "DBSOFT-ACE%d%d-%lu*", z, packagefiles[z], blah.st_size);
- append_file(packagefilename[z]);
- printf("Package: %s - %d files in %s (%lu bytes).\n", INSTALLER_PACKAGES[z], packagefiles[z], packagefilename[z], blah.st_size);
- }
- fclose(installfile);
- fclose(cfgfile);
- return 0;
- }
+ printf("Creating installer...\n");
+ append_file("sfx.exe");
+ fwrite("DBSOFT-HEADER", 1, 13, installfile);
+ while(!feof(cfgfile))
+ {
+ getline(cfgfile, entry, entrydata);
+ if(stricmp(entry, "INSTALLER_APPLICATION") == 0)
+ INSTALLER_APPLICATION = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_VERSION") == 0)
+ INSTALLER_VERSION = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_TITLE") == 0)
+ INSTALLER_TITLE = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_PATH") == 0)
+ INSTALLER_PATH = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_FOLDER") == 0)
+ INSTALLER_FOLDER = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_PROGRAM") == 0)
+ INSTALLER_PROGRAM = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_SHADOW") == 0)
+ INSTALLER_SHADOW = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_OBJECT") == 0)
+ INSTALLER_OBJECT = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_SETS") == 0)
+ INSTALLER_SETS = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_SYSVAR") == 0)
+ INSTALLER_SYSVAR = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_SYSLINE") == 0)
+ INSTALLER_SYSLINE = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_CONFIRM_WPS") == 0)
+ INSTALLER_CONFIRM_WPS = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_CONFIRM_CONFIGSYS") == 0)
+ INSTALLER_CONFIRM_CONFIGSYS = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_CONFIRM_OVERWRITE") == 0)
+ INSTALLER_CONFIRM_OVERWRITE = (char *)strdup(entrydata);
+ if(stricmp(entry, "INSTALLER_PACKAGE") == 0)
+ {
+ for(z=0;z<strlen(entrydata);z++)
+ {
+ if(entrydata[z] == ',')
+ {
+ entrydata[z] = 0;
+ packagefilename[INSTALLER_PACKAGE_COUNT] = (char *)strdup(entrydata);
+ INSTALLER_PACKAGES[INSTALLER_PACKAGE_COUNT] = (char *)strdup(&entrydata[z+1]);
+ }
+ }
+ resetglobals();
+ files=0;
+ include_unpack(packagefilename[INSTALLER_PACKAGE_COUNT]);
+ packagefiles[INSTALLER_PACKAGE_COUNT] = files;
+ INSTALLER_PACKAGE_COUNT++;
+ }
+ }
+ fclose(cfgfile);
+ fprintf(installfile, "%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%d",
+ INSTALLER_APPLICATION, INSTALLER_VERSION, INSTALLER_TITLE,
+ INSTALLER_PATH, INSTALLER_FOLDER, INSTALLER_PROGRAM,
+ INSTALLER_SHADOW, INSTALLER_OBJECT, INSTALLER_SETS, INSTALLER_SYSVAR,
+ INSTALLER_SYSLINE, INSTALLER_CONFIRM_WPS, INSTALLER_CONFIRM_CONFIGSYS,
+ INSTALLER_CONFIRM_OVERWRITE, INSTALLER_PACKAGE_COUNT);
+ for(z=0;z<INSTALLER_PACKAGE_COUNT;z++)
+ fprintf(installfile, "-%s", INSTALLER_PACKAGES[z]);
+ fwrite("*", 1, 1, installfile);
+ for(z=0;z<INSTALLER_PACKAGE_COUNT;z++)
+ {
+ struct stat blah;
+
+ stat(packagefilename[z], &blah);
+ fprintf(installfile, "DBSOFT-ACE%d%d-%lu*", z, packagefiles[z], blah.st_size);
+ append_file(packagefilename[z]);
+ printf("Package: %s - %d files in %s (%lu bytes).\n", INSTALLER_PACKAGES[z], packagefiles[z], packagefilename[z], blah.st_size);
+ }
+ fclose(installfile);
+ fclose(cfgfile);
+ return 0;
+}