gecko-dev/cck/ib/wizshell.cpp

104 lines
3.3 KiB
C++
Raw Normal View History

1999-11-16 02:09:40 +00:00
#include "stdafx.h"
#include "globals.h"
#include "fstream.h"
#include "direct.h"
#include <Winbase.h>
#include <direct.h>
#include "comp.h"
#include "ib.h"
#include <stdlib.h>
#define LATIN1_CODEPAGE 1252
1999-11-16 02:09:40 +00:00
extern CString rootPath;// = GetGlobal("Root");
extern CString configName;// = GetGlobal("CustomizationList");
extern CString configPath;// = rootPath + "Configs\\" + configName;
extern CString cdPath ;// = configPath + "\\CD";
extern CString workspacePath;// = configPath + "\\Workspace";
extern CString cdshellPath;
1999-11-16 02:09:40 +00:00
//CString CDout="CD_output";
void CreateRshell (void)
{
CString root = GetGlobal("Root");
CString config = GetGlobal("CustomizationList");
CString file1 = root + "\\part1.ini";
CString file2 = root + "\\part2.ini";
2000-02-25 20:48:23 +00:00
CString rshellPath = root + "\\Configs\\" + config + "\\Output\\Shell\\Nsetup32\\";
1999-11-16 02:09:40 +00:00
CWnd Mywnd;
// Mywnd.MessageBox(CString(iniFilePath),iniFilePath,MB_OK);
// Mywnd.MessageBox(CString(customizationPath),customizationPath,MB_OK);
ifstream part1(file1);
ifstream part2(file2);
_mkdir (rshellPath);
CString Rsh = rshellPath +"rshell.ini";
// FILE* rshell = theApp.OpenAFile(CDdir +"rshell.ini", "w");
ofstream rshell(Rsh);
CString captionValue = GetGlobal("BrowserName");
CString netscapeValue = "Netscape by ";
1999-11-16 02:09:40 +00:00
CString fvalue1=GetGlobal("ShellTitleText");
CString fvalue2=GetGlobal("ShellBgBitmap");
1999-12-21 02:34:06 +00:00
CString fvalue3=GetGlobal("ShellBelowTitleText");
1999-11-16 02:09:40 +00:00
CString fvalue4=GetGlobal("ShellInstallTextFile");
if (fvalue1.IsEmpty())
;
else
captionValue = netscapeValue + fvalue1;
1999-11-16 02:09:40 +00:00
char jsprefname[200];
if(!part1) {
cout << "cannot open the file \n";
}
while (!part1.eof()) {
part1.getline(jsprefname,200);
// fprintf(globs, jsprefname);
// fprintf(globs, "\n");
rshell <<jsprefname<<"\n";
}
rshell <<"caption="<<ConvertUTF8toANSI(captionValue)<<"\n";
// rshell <<"bk_bitmap="<<fvalue2<<"\n";
// rshell <<"button2_cmdline=exe,"<<fvalue4<<"\n";
1999-11-16 02:09:40 +00:00
rshell <<"dialog_title_text="<<ConvertUTF8toANSI(fvalue3)<<"\n";
1999-11-16 02:09:40 +00:00
if(!part2) {
cout << "cannot open the file \n";
}
while (!part2.eof()) {
part2.getline(jsprefname,200);
rshell <<jsprefname<<"\n";
}
rshell.close();
if (GetACP() != LATIN1_CODEPAGE)
{
// For non-western languages, change the western font specifications
// to blank in order to use the sytem font appropriate to the user's
// Windows regional setting
WritePrivateProfileString("Dialog1", "dialog_title_text_font", "", Rsh);
WritePrivateProfileString("Dialog1", "button_title_text_font", "", Rsh);
WritePrivateProfileString("Dialog1", "body_text_font", "", Rsh);
WritePrivateProfileString("Dialog2", "dialog_title_text_font", "", Rsh);
WritePrivateProfileString("Dialog2", "button_title_text_font", "", Rsh);
WritePrivateProfileString("Dialog2", "body_text_font", "", Rsh);
WritePrivateProfileString("Dialog3", "dialog_title_text_font", "", Rsh);
WritePrivateProfileString("Dialog3", "button_title_text_font", "", Rsh);
WritePrivateProfileString("Dialog3", "body_text_font", "", Rsh);
}
CString bmpdest = cdshellPath + "\\bmps\\Install.bmp";
CString txtdest = configPath + "\\Output\\install.txt";
CopyFile(fvalue2,bmpdest,FALSE);
CopyFile(fvalue4,txtdest,FALSE);
2000-03-27 22:18:11 +00:00
// Deleting the part1.ini and part2.ini files.
DeleteFile(rshellPath + "part1.ini");
DeleteFile(rshellPath + "part2.ini");
1999-11-16 02:09:40 +00:00
}