private static void CreateUserConfigPath ()
{
if (userDefine)
return;
if (ProductName == "")
ProductName = GetProductName ();
if (CompanyName == "")
CompanyName = GetCompanyName ();
if (ForceVersion == "")
ProductVersion = GetProductVersion ().Split('.');
// C:\Documents and Settings\(user)\Application Data
#if !TARGET_JVM
if (userRoamingBasePath == "")
userRoamingPath = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
else
#endif
userRoamingPath = userRoamingBasePath;
// C:\Documents and Settings\(user)\Local Settings\Application Data (on Windows)
#if !TARGET_JVM
if (userLocalBasePath == "")
userLocalPath = Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData);
else
#endif
userLocalPath = userLocalBasePath;
if (isCompany) {
userRoamingPath = Path.Combine (userRoamingPath, CompanyName);
userLocalPath = Path.Combine (userLocalPath, CompanyName);
}
if (isProduct) {
if (isEvidence) {
Assembly assembly = Assembly.GetEntryAssembly ();
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
#if !TARGET_JVM
byte [] pkt = assembly.GetName ().GetPublicKeyToken ();
ProductName = String.Format ("{0}_{1}_{2}",
ProductName,
pkt != null ? "StrongName" : "Url",
GetEvidenceHash());
#endif
}
userRoamingPath = Path.Combine (userRoamingPath, ProductName);
userLocalPath = Path.Combine (userLocalPath, ProductName);
}
string versionName;
if (ForceVersion == "") {
if (isVersionRevision)
versionName = String.Format ("{0}.{1}.{2}.{3}", ProductVersion [0], ProductVersion [1], ProductVersion [2], ProductVersion [3]);
else if (isVersionBuild)
versionName = String.Format ("{0}.{1}.{2}", ProductVersion [0], ProductVersion [1], ProductVersion [2]);
else if (isVersionMinor)
versionName = String.Format ("{0}.{1}", ProductVersion [0], ProductVersion [1]);
else if (isVersionMajor)
versionName = ProductVersion [0];
else
versionName = "";
}
else
versionName = ForceVersion;
string prevVersionRoaming = PrevVersionPath (userRoamingPath, versionName);
string prevVersionLocal = PrevVersionPath (userLocalPath, versionName);
userRoamingPath = Path.Combine (userRoamingPath, versionName);
userLocalPath = Path.Combine (userLocalPath, versionName);
if (prevVersionRoaming != "")
userRoamingPathPrevVersion = Path.Combine(userRoamingPath, prevVersionRoaming);
if (prevVersionLocal != "")
userLocalPathPrevVersion = Path.Combine(userLocalPath, prevVersionLocal);
}