@@ -44,6 +44,7 @@ public BuildEventInfo[] GetVars()
44
44
infos . Add ( new BuildEventInfo ( "FDBuild" , FDBuild ) ) ;
45
45
infos . Add ( new BuildEventInfo ( "ToolsDir" , ToolsDir ) ) ;
46
46
infos . Add ( new BuildEventInfo ( "TimeStamp" , DateTime . Now . ToString ( "g" ) ) ) ;
47
+ infos . Add ( new BuildEventInfo ( "UserAppDir" , UserAppDir ) ) ;
47
48
if ( project != null )
48
49
{
49
50
infos . Add ( new BuildEventInfo ( "OutputFile" , project . OutputPath ) ) ;
@@ -73,23 +74,33 @@ public string FDBuild
73
74
{
74
75
string url = Assembly . GetEntryAssembly ( ) . GetName ( ) . CodeBase ;
75
76
Uri uri = new Uri ( url ) ;
76
-
77
+
77
78
// special behavior if we're running in flashdevelop.exe
78
79
if ( Path . GetFileName ( uri . LocalPath ) . ToLower ( ) == DistroConfig . DISTRIBUTION_NAME . ToLower ( ) + ".exe" )
79
80
{
80
81
string startupDir = Path . GetDirectoryName ( uri . LocalPath ) ;
81
- string local = Path . Combine ( Path . GetDirectoryName ( uri . LocalPath ) , ".local" ) ;
82
- if ( ! File . Exists ( local ) )
83
- {
84
- String appDir = Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) ;
85
- startupDir = Path . Combine ( appDir , DistroConfig . DISTRIBUTION_NAME ) ;
86
- }
82
+ //NOTE: FDBuild does not exist in AppData\Local\FlashDevelop; code commented out in case of reuse
83
+ //string local = Path.Combine(Path.GetDirectoryName(uri.LocalPath), ".local");
84
+ //if (!File.Exists(local))
85
+ //{
86
+ // String appDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
87
+ // startupDir = Path.Combine(appDir, DistroConfig.DISTRIBUTION_NAME);
88
+ //}
87
89
string toolsDir = Path . Combine ( startupDir , "Tools" ) ;
88
90
string fdbuildDir = Path . Combine ( toolsDir , "fdbuild" ) ;
89
91
return Path . Combine ( fdbuildDir , "fdbuild.exe" ) ;
90
92
}
91
93
else return uri . LocalPath ;
92
94
}
93
95
}
96
+
97
+ public string UserAppDir
98
+ {
99
+ get
100
+ {
101
+ string localAppData = Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) ;
102
+ return Path . Combine ( localAppData , DistroConfig . DISTRIBUTION_NAME ) ;
103
+ }
104
+ }
94
105
}
95
106
}
0 commit comments