From a1f4ebd45a8a2069b0ce7de4bf62ad98ec2ba0c0 Mon Sep 17 00:00:00 2001 From: Jeff <632006142@qq.com> Date: Wed, 3 Jun 2026 18:33:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dinno=20setup=E4=B8=AD?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=9A=84=E7=89=88=E6=9C=AC=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GitVer/GitVer_setup.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/GitVer/GitVer_setup.cpp b/GitVer/GitVer_setup.cpp index 1c89fea..c157c4e 100644 --- a/GitVer/GitVer_setup.cpp +++ b/GitVer/GitVer_setup.cpp @@ -30,9 +30,7 @@ static const UINT DEFAULT_MINOR_WHEN_NO_TAG_FOR_SETUP = 0; /// 在字符串内容中查找首个包含 strToken 的整行, /// 用 strNewLine 替换该行(不含行尾换行符)。 /// -static BOOL ReplaceLineByToken(std::string& strContent, - const std::string& strToken, - const std::string& strNewLine) +static BOOL ReplaceLineByToken(std::string& strContent, const std::string& strToken, const std::string& strNewLine) { std::string::size_type nPos = strContent.find(strToken); if (nPos == std::string::npos) @@ -119,17 +117,17 @@ static BOOL ModifyIssScript(const CString& strScriptPath, const CString& strFile return FALSE; } - const std::string strToken = "#define MyAppVersion "; + const std::string strToken = "#define MyAppVersion "; if (strContent.find(strToken) == std::string::npos) { - _tprintf(_T("错误: .iss 文件中未找到 #define MyAppVersion 行: %s\n"), strScriptPath.GetString()); + _tprintf(_T("错误: .iss 文件中未找到 #define MyAppVersion 行: %s\n"), strScriptPath.GetString()); return FALSE; } - std::string strNewLine = "#define MyAppVersion \"" + ToAnsiString(strFileVersion.GetString()) + "\""; + std::string strNewLine = "#define MyAppVersion \"" + ToAnsiString(strFileVersion.GetString()) + "\""; if (!ReplaceLineByToken(strContent, strToken, strNewLine)) { - _tprintf(_T("错误: 替换 .iss #define MyAppVersion 行失败。\n")); + _tprintf(_T("错误: 替换 .iss #define MyAppVersion 行失败。\n")); return FALSE; } @@ -139,7 +137,7 @@ static BOOL ModifyIssScript(const CString& strScriptPath, const CString& strFile return FALSE; } - _tprintf(_T("成功: 已更新 .iss #define MyAppVersion \"%s\"\n"), strFileVersion.GetString()); + _tprintf(_T("成功: 已更新 .iss #define MyAppVersion \"%s\"\n"), strFileVersion.GetString()); return TRUE; }