Skip to content

Commit

Permalink
Prepare offline whatsnew simplification, fix pre-release whatsnew URL
Browse files Browse the repository at this point in the history
First step: do not deploy reaper_sws_whatsnew.txt on Win
This text file is more like an internal doc (not too human-friendly, used to generate the HTML what's new)
Pro: reduce installation "spam", consistent with OS X
Drawback: no more offline what's new on Win

Future plan: may be we could directly edit/release an (enhanced) HTML whatsnew
and drop the intenal txt version, as well as the MakeWhatsNew sub-project, etc
Such a whatsnew.html could be added to the DMG (OS X) and NSIS installers (Win),
so it'd be up to the user to install the  offline version (or not) -- which would
also solve OS X deployment issues...
  • Loading branch information
Jeff0S committed Feb 12, 2016
1 parent 7ceba28 commit 95175a8
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 76 deletions.
2 changes: 1 addition & 1 deletion Install/sws_extension.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Section "Extension DLL" extension_id
Delete "$INSTDIR\Plugins\reaper_fingers.dll"
Delete "$INSTDIR\Plugins\reaper_dragzoom.dll"
Delete "$INSTDIR\Plugins\reaper_WT_InTheSky.dll"
Delete "$INSTDIR\Plugins\reaper_sws_whatsnew.txt"
File ${OUT_DLL}
File ${OUT_PY}
File /oname=$INSTDIR\Plugins\reaper_sws_whatsnew.txt ..\whatsnew.txt
Abort:
SectionEnd

Expand Down
8 changes: 8 additions & 0 deletions SnM/SnM_Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,14 @@ void SNM_UpgradeIniFiles(int _iniVersion)
WritePrivateProfileString("NbOfActions", "S&M_LIVECFG_FADES_TGL", NULL, g_SNM_IniFn.Get());
WritePrivateProfileString("NbOfActions", "S&M_LIVECFG_FADES_ON", NULL, g_SNM_IniFn.Get());
WritePrivateProfileString("NbOfActions", "S&M_LIVECFG_FADES_OFF", NULL, g_SNM_IniFn.Get());

// reaper_sws_whatsnew.txt is not deployed anymore (replaced with online help)
// note: on Win, this file is removed by NSIS installers
#ifndef _WIN32
WDL_FastString fn;
fn.SetFormatted(SNM_MAX_PATH, "%s/UserPlugins/reaper_sws_whatsnew.txt", GetResourcePath());
SNM_DeleteFile(fn.Get(), false); // lazy cleanup
#endif
}
}

Expand Down
4 changes: 0 additions & 4 deletions reaper_sws.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@
3879391016202B1E000948B5 /* StringUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 387938E216202B1E000948B5 /* StringUtil.h */; };
3879391116202B1E000948B5 /* TimeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 387938E316202B1E000948B5 /* TimeMap.cpp */; };
3879391216202B1E000948B5 /* TimeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 387938E416202B1E000948B5 /* TimeMap.h */; };
389293241601487C00F16794 /* MakeWhatsNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 389293231601487C00F16794 /* MakeWhatsNew.cpp */; };
38B8AD451601269E001F3F3C /* ReaScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38B8AD431601269E001F3F3C /* ReaScript.cpp */; };
4D859DBB16AB128700E34EAA /* BR_Misc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D859DAD16AB128700E34EAA /* BR_Misc.cpp */; };
4D859DBC16AB128700E34EAA /* BR_Misc.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D859DAE16AB128700E34EAA /* BR_Misc.h */; };
Expand Down Expand Up @@ -610,7 +609,6 @@
387938E216202B1E000948B5 /* StringUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringUtil.h; path = Fingers/StringUtil.h; sourceTree = "<group>"; };
387938E316202B1E000948B5 /* TimeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TimeMap.cpp; path = Fingers/TimeMap.cpp; sourceTree = "<group>"; };
387938E416202B1E000948B5 /* TimeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TimeMap.h; path = Fingers/TimeMap.h; sourceTree = "<group>"; };
389293231601487C00F16794 /* MakeWhatsNew.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MakeWhatsNew.cpp; path = BuildUtils/MakeWhatsNew.cpp; sourceTree = "<group>"; };
38B8AD431601269E001F3F3C /* ReaScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReaScript.cpp; sourceTree = "<group>"; };
4D859DAD16AB128700E34EAA /* BR_Misc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BR_Misc.cpp; path = Breeder/BR_Misc.cpp; sourceTree = "<group>"; };
4D859DAE16AB128700E34EAA /* BR_Misc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BR_Misc.h; path = Breeder/BR_Misc.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -770,7 +768,6 @@
981006D80F4768010072D712 /* Freeze.h */,
981006D40F4768010072D712 /* ItemSelState.cpp */,
981006D60F4768010072D712 /* ItemSelState.h */,
389293231601487C00F16794 /* MakeWhatsNew.cpp */,
981006F10F4768020072D712 /* MarkerActions.cpp */,
981006F20F4768020072D712 /* MarkerActions.h */,
229AC7F2108F985C00E4A962 /* MarkerList.cpp */,
Expand Down Expand Up @@ -1669,7 +1666,6 @@
22F7AAEA15201E2600CC1481 /* Label.cpp in Sources */,
22F7AAEB15201E2600CC1481 /* PlaylistImport.cpp in Sources */,
38B8AD451601269E001F3F3C /* ReaScript.cpp in Sources */,
389293241601487C00F16794 /* MakeWhatsNew.cpp in Sources */,
387938E516202B1E000948B5 /* CommandHandler.cpp in Sources */,
387938E716202B1E000948B5 /* Envelope.cpp in Sources */,
387938E916202B1E000948B5 /* EnvelopeCommands.cpp in Sources */,
Expand Down
53 changes: 1 addition & 52 deletions sws_about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,67 +36,16 @@
#include "Prompt.h"


#define WHATSNEW_HTM "%ssws_whatsnew.html"
#ifdef _WIN32
#define WHATSNEW_TXT "%s\\Plugins\\reaper_sws_whatsnew.txt"
#else
#define WHATSNEW_TXT "%s/UserPlugins/reaper_sws_whatsnew.txt" // deprecated, not deployed on OSX anymore
#endif


static HWND s_hwndAbout = NULL;


bool IsOfficialVersion()
{
return (_stricmp(SWS_VERSION_TYPE, "Featured") == 0); // otherwise: pre-release, beta, etc
}

void WhatsNew(COMMAND_T*)
{
WDL_FastString fnIn;
fnIn.SetFormatted(BUFFER_SIZE, WHATSNEW_TXT,
#ifdef _WIN32
GetExePath());
#else
GetResourcePath());
#endif

#ifndef _WIN32 // reaper_sws_whatsnew.txt not deployed on OSX anymore, replaced with online help
if (FileOrDirExistsErrMsg(fnIn.Get(), false))
{
SNM_DeleteFile(fnIn.Get(), false); // lazy cleanup
}

if (!IsOfficialVersion())
{
WDL_FastString url;
url.SetFormatted(512, SWS_URL_BETA_WHATSNEW, SWS_VERSION);
ShellExecute(GetMainHwnd(), "open", url.Get(), NULL, NULL, SW_SHOWNORMAL);
}
else
{
ShellExecute(GetMainHwnd(), "open", SWS_URL_WHATSNEW, NULL, NULL, SW_SHOWNORMAL);
}
#else
if (FileOrDirExistsErrMsg(fnIn.Get()))
{
WDL_FastString fnOut;
char tmpDir[BUFFER_SIZE] = "";
GetTempPath(sizeof(tmpDir), tmpDir);
fnOut.SetFormatted(BUFFER_SIZE, WHATSNEW_HTM, tmpDir);

if (!GenHtmlWhatsNew(fnIn.Get(), fnOut.Get(), true, SWS_URL))
{
ShellExecute(GetMainHwnd(), "open", fnOut.Get(), NULL, NULL, SW_SHOWNORMAL);
}
else
{
MessageBox(GetMainHwnd(), __LOCALIZE("The generation of the \"What's new?\" HTML page has failed!\nOpening a raw text file instead...","sws_DLG_109"), __LOCALIZE("SWS - Warning","sws_DLG_109"), MB_OK);
ShellExecute(GetMainHwnd(), "open", fnIn.Get(), NULL, NULL, SW_SHOWNORMAL);
}
}
#endif
ShellExecute(GetMainHwnd(), "open", IsOfficialVersion() ? SWS_URL_WHATSNEW : SWS_URL_BETA_WHATSNEW, NULL, NULL, SW_SHOWNORMAL);
}

INT_PTR WINAPI doAbout(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Expand Down
10 changes: 0 additions & 10 deletions sws_extension.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1348,16 +1348,6 @@ echo Copied to "$(REAPER64_DIR)\plugins\$(TargetFilename)"</Command>
<ClCompile Include="Snapshots\SnapshotClass.cpp" />
<ClCompile Include="Snapshots\SnapshotMerge.cpp" />
<ClCompile Include="Snapshots\Snapshots.cpp" />
<ClCompile Include="BuildUtils\MakeWhatsNew.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Test|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Test|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Reascript.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
Expand Down
3 changes: 0 additions & 3 deletions sws_extension.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1037,9 +1037,6 @@
<ClCompile Include="Snapshots\Snapshots.cpp">
<Filter>Snapshots</Filter>
</ClCompile>
<ClCompile Include="BuildUtils\MakeWhatsNew.cpp">
<Filter>Core</Filter>
</ClCompile>
<ClCompile Include="Reascript.cpp">
<Filter>Core</Filter>
</ClCompile>
Expand Down
3 changes: 0 additions & 3 deletions sws_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,6 @@ bool IsLocalizableAction(const char* _customId);
TrackEnvelope* SWS_GetTakeEnvelopeByName(MediaItem_Take* take, const char* envname);
TrackEnvelope* SWS_GetTrackEnvelopeByName(MediaTrack* track, const char* envname);

// Generate html whatsnew, MakeWhatsNew.cpp
int GenHtmlWhatsNew(const char* fnIn, const char* fnOut, bool bFullHTML, const char* _url);

// Functions export to reascript and c++ plugins, Reascript.cpp
bool RegisterExportedFuncs(reaper_plugin_info_t* _rec);
void UnregisterExportedFuncs();
Expand Down
5 changes: 2 additions & 3 deletions url.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#define SWS_URL_VERSION_H SWS_URL "/download/featured/version.h"
#define SWS_URL_BETA_DOWNLOAD SWS_URL "/download/pre-release/"
#define SWS_URL_BETA_VERSION_H SWS_URL "/download/pre-release/version.h"
#define SWS_URL_HELP_DIR SWS_URL // e.g. SWS_URL_HELP "/reaconsole.php"
#define SWS_URL_HELP_DIR SWS_URL
#define SWS_URL_WHATSNEW SWS_URL "/whatsnew.php"
#define SWS_URL_BETA_WHATSNEW SWS_URL "/download/pre-release/whatsnew-v%d.%d.%d.%d.html"

#define SWS_URL_BETA_WHATSNEW SWS_URL "/download/pre-release/whatsnew.html"

0 comments on commit 95175a8

Please sign in to comment.