diff --git a/GreenshotBoxPlugin/BoxCredentials.cs b/GreenshotBoxPlugin/BoxCredentials.cs
index f155cad1b..b5252304a 100644
--- a/GreenshotBoxPlugin/BoxCredentials.cs
+++ b/GreenshotBoxPlugin/BoxCredentials.cs
@@ -23,10 +23,10 @@ using System;
namespace GreenshotBoxPlugin {
///
/// This class is merely a placeholder for the file keeping the API key and secret for Box integration.
- /// Copy this file to BoxCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the plugin then.)
+ /// You can set your own values here
///
public static class BoxCredentials {
- public static string ClientId = string.Empty;
- public static string ClientSecret = string.Empty;
+ public static string ClientId = "1234";
+ public static string ClientSecret = "@credentials_box_client_secret@";
}
-}
\ No newline at end of file
+}
diff --git a/GreenshotBoxPlugin/GreenshotBoxPlugin.csproj b/GreenshotBoxPlugin/GreenshotBoxPlugin.csproj
index 5a3f06622..3a615f4c0 100644
--- a/GreenshotBoxPlugin/GreenshotBoxPlugin.csproj
+++ b/GreenshotBoxPlugin/GreenshotBoxPlugin.csproj
@@ -68,7 +68,7 @@
if exist "$(ProjectDir)BoxCredentials.orig.cs" (
rename "$(ProjectDir)BoxCredentials.cs" "BoxCredentials.private.cs"
rename "$(ProjectDir)BoxCredentials.orig.cs" "BoxCredentials.cs"
-) else exit /b -1
+)
mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
@@ -80,34 +80,6 @@ copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Language
if exist "$(ProjectDir)BoxCredentials.private.cs" (
rename "$(ProjectDir)BoxCredentials.cs" "BoxCredentials.orig.cs"
rename "$(ProjectDir)BoxCredentials.private.cs" "BoxCredentials.cs"
-) else exit /b -1
-
-
- False
- Off
- 4194304
- x86
- 4096
-
-
- False
- Off
- 4194304
- AnyCPU
- 4096
-
-
- DEBUG;TRACE
- False
- True
- Full
- true
-
-
- TRACE
- True
- False
- None
- false
+)
\ No newline at end of file
diff --git a/GreenshotDropboxPlugin/DropBoxCredentials.cs b/GreenshotDropboxPlugin/DropBoxCredentials.cs
index 14174b077..8ff722de9 100644
--- a/GreenshotDropboxPlugin/DropBoxCredentials.cs
+++ b/GreenshotDropboxPlugin/DropBoxCredentials.cs
@@ -22,10 +22,10 @@
namespace GreenshotDropboxPlugin {
///
/// This class is merely a placeholder for the file keeping the API key and secret for dropbox integration.
- /// Copy this file to DropBoxCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the DropBox plugin then.)
+ /// You can set your own values here
///
public static class DropBoxCredentials {
- public static string CONSUMER_KEY = empty;
- public static string CONSUMER_SECRET = empty;
+ public static string CONSUMER_KEY = "@credentials_dropbox_consumer_key@";
+ public static string CONSUMER_SECRET = "@credentials_dropbox_consumer_secret@";
}
}
diff --git a/GreenshotDropboxPlugin/GreenshotDropboxPlugin.csproj b/GreenshotDropboxPlugin/GreenshotDropboxPlugin.csproj
index 937b09d2b..a9f9a0092 100644
--- a/GreenshotDropboxPlugin/GreenshotDropboxPlugin.csproj
+++ b/GreenshotDropboxPlugin/GreenshotDropboxPlugin.csproj
@@ -61,8 +61,7 @@
if exist "$(ProjectDir)DropBoxCredentials.orig.cs" (
rename "$(ProjectDir)DropBoxCredentials.cs" "DropBoxCredentials.private.cs"
rename "$(ProjectDir)DropBoxCredentials.orig.cs" "DropBoxCredentials.cs"
-) else exit /b -1
-
+)
mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\"
@@ -73,34 +72,6 @@ copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Language
if exist "$(ProjectDir)DropBoxCredentials.private.cs" (
rename "$(ProjectDir)DropBoxCredentials.cs" "DropBoxCredentials.orig.cs"
rename "$(ProjectDir)DropBoxCredentials.private.cs" "DropBoxCredentials.cs"
-) else exit /b -1
-
-
- False
- Off
- 4194304
- x86
- 4096
-
-
- False
- Off
- 4194304
- AnyCPU
- 4096
-
-
- DEBUG;TRACE
- False
- True
- Full
- true
-
-
- TRACE
- True
- False
- None
- false
+)
\ No newline at end of file
diff --git a/GreenshotFlickrPlugin/FlickrCredentials.cs b/GreenshotFlickrPlugin/FlickrCredentials.cs
index ed79453f5..0d08b7701 100644
--- a/GreenshotFlickrPlugin/FlickrCredentials.cs
+++ b/GreenshotFlickrPlugin/FlickrCredentials.cs
@@ -22,10 +22,10 @@
namespace GreenshotFlickrPlugin {
///
/// This class is merely a placeholder for the file keeping the API key and secret for dropbox integration.
- /// Copy this file to FlickrCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the DropBox plugin then.)
+ /// You can set your own values here
///
public static class FlickrCredentials {
- public static string ConsumerKey = empty;
- public static string ConsumerSecret = empty;
+ public static string ConsumerKey = "@credentials_flickr_consumer_key@";
+ public static string ConsumerSecret = "@credentials_flickr_consumer_secret@";
}
}
diff --git a/GreenshotFlickrPlugin/GreenshotFlickrPlugin.csproj b/GreenshotFlickrPlugin/GreenshotFlickrPlugin.csproj
index ce9547f7d..50ee51535 100644
--- a/GreenshotFlickrPlugin/GreenshotFlickrPlugin.csproj
+++ b/GreenshotFlickrPlugin/GreenshotFlickrPlugin.csproj
@@ -65,7 +65,7 @@
if exist "$(ProjectDir)FlickrCredentials.orig.cs" (
rename "$(ProjectDir)FlickrCredentials.cs" "FlickrCredentials.private.cs"
rename "$(ProjectDir)FlickrCredentials.orig.cs" "FlickrCredentials.cs"
-) else exit /b -1
+)
mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
@@ -76,34 +76,6 @@ copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Language
if exist "$(ProjectDir)FlickrCredentials.private.cs" (
rename "$(ProjectDir)FlickrCredentials.cs" "FlickrCredentials.orig.cs"
rename "$(ProjectDir)FlickrCredentials.private.cs" "FlickrCredentials.cs"
-) else exit /b -1
-
-
- False
- Off
- 4194304
- x86
- 4096
-
-
- False
- Off
- 4194304
- AnyCPU
- 4096
-
-
- DEBUG;TRACE
- False
- True
- Full
- true
-
-
- TRACE
- True
- False
- None
- false
+)
\ No newline at end of file
diff --git a/GreenshotImgurPlugin/GreenshotImgurPlugin.csproj b/GreenshotImgurPlugin/GreenshotImgurPlugin.csproj
index ca58f59b2..8cdaff142 100644
--- a/GreenshotImgurPlugin/GreenshotImgurPlugin.csproj
+++ b/GreenshotImgurPlugin/GreenshotImgurPlugin.csproj
@@ -81,11 +81,11 @@
if exist "$(ProjectDir)ImgurCredentials.private.cs" (
rename "$(ProjectDir)ImgurCredentials.cs" "ImgurCredentials.orig.cs"
rename "$(ProjectDir)ImgurCredentials.private.cs" "ImgurCredentials.cs"
-) else exit /b -1
+)
if exist "$(ProjectDir)ImgurCredentials.orig.cs" (
rename "$(ProjectDir)ImgurCredentials.cs" "ImgurCredentials.private.cs"
rename "$(ProjectDir)ImgurCredentials.orig.cs" "ImgurCredentials.cs"
-) else exit /b -1
+)
mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
@@ -93,32 +93,4 @@ copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)bin\$
mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\"
-
- False
- True
- Full
- true
- DEBUG;TRACE
-
-
- False
- Off
- 4194304
- AnyCPU
- 4096
-
-
- True
- False
- None
- false
- TRACE
-
-
- False
- Off
- 4194304
- x86
- 4096
-
\ No newline at end of file
diff --git a/GreenshotImgurPlugin/ImgurCredentials.cs b/GreenshotImgurPlugin/ImgurCredentials.cs
index c36132413..3f363ad73 100644
--- a/GreenshotImgurPlugin/ImgurCredentials.cs
+++ b/GreenshotImgurPlugin/ImgurCredentials.cs
@@ -22,10 +22,10 @@
namespace GreenshotImgurPlugin {
///
/// This class is merely a placeholder for the file keeping the API key and secret for imgur integration.
- /// Copy this file to ImgurCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the Imgur plugin then.)
+ /// You can set your own values here
///
public static class ImgurCredentials {
- public static string CONSUMER_KEY = empty;
- public static string CONSUMER_SECRET = empty;
+ public static string CONSUMER_KEY = "@credentials_imgur_consumer_key@";
+ public static string CONSUMER_SECRET = "@credentials_imgur_consumer_secret@";
}
-}
\ No newline at end of file
+}
diff --git a/GreenshotPhotobucketPlugin/PhotobucketCredentials.cs b/GreenshotPhotobucketPlugin/PhotobucketCredentials.cs
index dd20601b2..767b36f66 100644
--- a/GreenshotPhotobucketPlugin/PhotobucketCredentials.cs
+++ b/GreenshotPhotobucketPlugin/PhotobucketCredentials.cs
@@ -22,10 +22,10 @@
namespace GreenshotPhotobucketPlugin {
///
/// This class is merely a placeholder for the file keeping the API key and secret for photobucket integration.
- /// Copy this file to PhotobucketCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the Photobucket plugin then.)
+ /// You can set your own values here
///
public static class PhotobucketCredentials {
- public static string ConsumerKey = empty;
- public static string ConsumerSecret = empty;
+ public static string ConsumerKey = "@credentials_photobucket_consumer_key@";
+ public static string ConsumerSecret = "@credentials_photobucket_consumer_secret@";
}
}
diff --git a/GreenshotPicasaPlugin/GreenshotPicasaPlugin.csproj b/GreenshotPicasaPlugin/GreenshotPicasaPlugin.csproj
index beff8f9cb..6665af439 100644
--- a/GreenshotPicasaPlugin/GreenshotPicasaPlugin.csproj
+++ b/GreenshotPicasaPlugin/GreenshotPicasaPlugin.csproj
@@ -71,7 +71,7 @@
if exist "$(ProjectDir)PicasaCredentials.orig.cs" (
rename "$(ProjectDir)PicasaCredentials.cs" "PicasaCredentials.private.cs"
rename "$(ProjectDir)PicasaCredentials.orig.cs" "PicasaCredentials.cs"
-) else exit /b -1
+)
mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
@@ -83,34 +83,6 @@ copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Language
if exist "$(ProjectDir)PicasaCredentials.private.cs" (
rename "$(ProjectDir)PicasaCredentials.cs" "PicasaCredentials.orig.cs"
rename "$(ProjectDir)PicasaCredentials.private.cs" "PicasaCredentials.cs"
-) else exit /b -1
-
-
- False
- True
- DEBUG;TRACE
- Full
- true
-
-
- False
- Off
- 4194304
- x86
- 4096
-
-
- False
- Off
- 4194304
- AnyCPU
- 4096
-
-
- True
- False
- TRACE
- None
- false
+)
\ No newline at end of file
diff --git a/GreenshotPicasaPlugin/PicasaCredentials.cs b/GreenshotPicasaPlugin/PicasaCredentials.cs
index a542e10c0..a085211fe 100644
--- a/GreenshotPicasaPlugin/PicasaCredentials.cs
+++ b/GreenshotPicasaPlugin/PicasaCredentials.cs
@@ -22,10 +22,10 @@
namespace GreenshotPicasaPlugin {
///
/// This class is merely a placeholder for the file keeping the API key and secret for dropbox integration.
- /// Copy this file to PicasaCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the DropBox plugin then.)
+ /// You can set your own values here
///
public static class PicasaCredentials {
- public static string ConsumerKey = empty;
- public static string ConsumerSecret = empty;
+ public static string ConsumerKey = "@credentials_picasa_consumer_key@";
+ public static string ConsumerSecret = "@credentials_picasa_consumer_secret@";
}
}
diff --git a/build.ps1 b/build.ps1
index 8f68f157c..283c0ed29 100644
--- a/build.ps1
+++ b/build.ps1
@@ -217,8 +217,4 @@ echo "Generating ZIP"
PackageZip
echo "Generating Portable"
-PackagePortable
-
-echo "Ready, press any key to continue!"
-
-WaitForKey
+PackagePortable
\ No newline at end of file
diff --git a/prebuild.ps1 b/prebuild.ps1
new file mode 100644
index 000000000..00c414041
--- /dev/null
+++ b/prebuild.ps1
@@ -0,0 +1,46 @@
+################################################################
+# Greenshot PRE-BUILD script, written for the Windows Power Shell
+# Assumes the installation of Microsoft .NET Framework 4.5
+################################################################
+# Greenshot - a free and open source screenshot tool
+# Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
+#
+# For more information see: http://getgreenshot.org/
+# The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 1 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+################################################################
+
+# Fill the credentials
+Function FillCredentials {
+ Write-Host "Filling credentials with Environment variable values`n`n"
+ Get-ChildItem . -recurse *Credentials.cs | foreach {
+ $template = Get-Content $_.FullName
+ # Create an empty array, this will contain the replaced lines
+ $newtext = @()
+ foreach ($line in $template) {
+ get-childitem -path env:credentials_* | foreach {
+ $varname=$_.Name
+ $varvalue=$_.Value
+ $line = $line -replace "\@$varname\@", $varvalue
+ }
+ $newtext += $line
+ }
+ # Write the new information to the file
+ Write-Host "Updating $_.FullName`n"
+ $newtext | Set-Content $_.FullName -encoding UTF8
+ }
+}
+
+FillCredentials