local sDefaultFolder = Input.GetText("Out_dir"); local sInSectionName = "update_info"; local sOutFileName = "update.ver"; local tFiles = File.Find(sDefaultFolder, "*.nup", false, false, nil, nil); if (tFiles) then for nIdx, sFileName in pairs(tFiles) do local tValueNames = INIFile.GetValueNames(sFileName, sInSectionName); if (tValueNames) then local tData = {}; for nId, sValueName in pairs(tValueNames) do tData[sValueName] = INIFile.GetValue(sFileName, sInSectionName, sValueName); end local sOutSectionName = tData["name"]; local tValueSize = File.GetSize(sFileName, sInSectionName); if (sOutSectionName) then for sIdx, sValue in pairs(tData) do if (sIdx) ~= "name" then INIFile.SetValue(sDefaultFolder.."\\"..sOutFileName, sOutSectionName, sIdx, sValue); INIFile.DeleteValue(sDefaultFolder.."\\"..sOutFileName, sOutSectionName, "filesize"); INIFile.DeleteValue(sDefaultFolder.."\\"..sOutFileName, sOutSectionName, "filename"); INIFile.DeleteValue(sDefaultFolder.."\\"..sOutFileName, sOutSectionName, "crc"); INIFile.SetValue(sDefaultFolder.."\\"..sOutFileName, sOutSectionName, "size", tValueSize); INIFile.SetValue(sDefaultFolder.."\\"..sOutFileName, sOutSectionName, "file", sFileName); end end end end end end |