diff --git a/Resources/ScriptLoader.cs b/Resources/ScriptLoader.cs index 96bc0717..3c68b286 100644 --- a/Resources/ScriptLoader.cs +++ b/Resources/ScriptLoader.cs @@ -11,7 +11,7 @@ static class ScriptLoader{ public static string LoadResource(string name){ try{ - return File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, name), Encoding.UTF8); + return File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "scripts", name), Encoding.UTF8); }catch(Exception ex){ MessageBox.Show("Unfortunately, "+Program.BrandName+" could not load the "+name+" file. The program will continue running with limited functionality.\r\n\r\n"+ex.Message, Program.BrandName+" Has Failed :(", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; diff --git a/TweetDck.csproj b/TweetDck.csproj index d43782d9..9767ecc0 100644 --- a/TweetDck.csproj +++ b/TweetDck.csproj @@ -310,36 +310,6 @@ <TargetPath>icon.ico</TargetPath> </ContentWithTargetPath> </ItemGroup> - <ItemGroup> - <ContentWithTargetPath Include="Resources\Scripts\code.js"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - <TargetPath>code.js</TargetPath> - </ContentWithTargetPath> - </ItemGroup> - <ItemGroup> - <ContentWithTargetPath Include="Resources\Scripts\notification.js"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - <TargetPath>notification.js</TargetPath> - </ContentWithTargetPath> - </ItemGroup> - <ItemGroup> - <ContentWithTargetPath Include="Resources\Scripts\plugins.browser.js"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - <TargetPath>plugins.browser.js</TargetPath> - </ContentWithTargetPath> - </ItemGroup> - <ItemGroup> - <ContentWithTargetPath Include="Resources\Scripts\plugins.notification.js"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - <TargetPath>plugins.notification.js</TargetPath> - </ContentWithTargetPath> - </ItemGroup> - <ItemGroup> - <ContentWithTargetPath Include="Resources\Scripts\update.js"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - <TargetPath>update.js</TargetPath> - </ContentWithTargetPath> - </ItemGroup> <ItemGroup> <None Include="Resources\icon-small.ico" /> <None Include="Resources\icon-tray-new.ico" /> @@ -347,6 +317,7 @@ </ItemGroup> <ItemGroup> <Folder Include="Resources\Plugins\" /> + <Folder Include="Resources\Scripts\" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> @@ -370,6 +341,10 @@ ren "$(TargetDir)LICENSE.md" "LICENSE.txt" xcopy "$(ProjectDir)Libraries\CEFSHARP-LICENSE.txt" "$(TargetDir)" /Y xcopy "$(ProjectDir)packages\Microsoft.VC120.CRT.JetBrains.12.0.21005.2\DotFiles\msvcp120.dll" "$(TargetDir)" /Y xcopy "$(ProjectDir)packages\Microsoft.VC120.CRT.JetBrains.12.0.21005.2\DotFiles\msvcr120.dll" "$(TargetDir)" /Y +rmdir "$(TargetDir)scripts" +mkdir "$(TargetDir)scripts" +xcopy "$(ProjectDir)Resources\Scripts\*" "$(TargetDir)scripts\" /E /Y +rmdir "$(TargetDir)plugins" mkdir "$(TargetDir)plugins" mkdir "$(TargetDir)plugins\official" mkdir "$(TargetDir)plugins\user"