templinuxPath = tempPath; templinuxPath.Replace("\\", "/"); templinuxPath.Replace(":",""); templinuxPath.Insert(0,"/cygdrive/"); CString command = "tar -zcvf " + tarfile + " -C " +quotes+ templinuxPath + "/" + templinuxDir +quotes+ spaces + nsinstallerDir;
int pos = targzfile.ReverseFind('.'); CString tarfile = targzfile.Left(pos); CopyFile(nscpxpiPath+"\\"+tarfile, xpiDstPath+"\\"+tarfile, FALSE); templinuxDirPath.Replace("\\", "/"); templinuxDirPath.Replace(":",""); templinuxDirPath.Insert(0,"/cygdrive/");   CString command = "tar -rvf " + tarfile + " -C " + quotes + templinuxDirPath + quotes + spaces + strNscpInstaller; ExecuteCommand((char *)(LPCTSTR) command, SW_HIDE, INFINITE);   command = "gzip " + tarfile;
void CreateLinuxInstaller(){	char currentdir[_MAX_PATH];	_getcwd(currentdir,_MAX_PATH);	if (FileExists(xpiDstPath+"\\"+tarfile))		DeleteFile(xpiDstPath+"\\"+tarfile);	CopyDirectory(xpiDstPath, templinuxPath + xpiDir, TRUE);	CopyFile(xpiDstPath+"\\Config.ini", templinuxPath+"\\Config.ini",FALSE);	DeleteFile(templinuxPath + xpiDir + "\\Config.ini");	FILE *fout = fopen(templinuxPath+"\\config.tmp", "wb");	if (!fout)	{		AfxMessageBox("Cannot open output file", MB_OK);		exit(3);	}		FILE *fin = fopen(templinuxPath+"\\Config.ini", "rb");	if (!fin)	{		AfxMessageBox("Cannot open Config.ini file", MB_OK);		exit(3);	}	else 	{		char inbuf[BUF_SIZE], outbuf[BUF_SIZE];		int cnt2=0;		while(!feof(fin))		{			int count = fread(&inbuf, sizeof(char), sizeof(inbuf), fin);			if (ferror(fin))			{				AfxMessageBox("Error in reading Config.ini file", MB_OK);				exit(3);			}			char *cpin = inbuf;			char *cpout = outbuf;			while (count-- > 0)			{				if (*cpin == CRVALUE)					cpin++;				else				{					*cpout++ = *cpin++;					cnt2++;				}			}			fwrite(&outbuf, sizeof(char), cnt2, fout);			if (ferror(fout))			{				AfxMessageBox("Error in writing Config.ini file", MB_OK);				exit(3);			}			cnt2=0;		}		fclose(fin);	}	fputs("[END]\n", fout);	fclose(fout);	DeleteFile(templinuxPath+"\\Config.ini");	rename(templinuxPath+"\\config.tmp",templinuxPath+"\\config.ini");		_chdir(outputPath);	templinuxPath = tempPath;	templinuxPath.Replace("\\", "/");	templinuxPath.Replace(":","");	templinuxPath.Insert(0,"/cygdrive/");	CString command = "tar -zcvf " + tarfile + " -C " +quotes+ templinuxPath + "/" + templinuxDir +quotes+ spaces + nsinstallerDir;    	ExecuteCommand((char *)(LPCTSTR) command, SW_HIDE, INFINITE);	_chdir(currentdir);}