@@ -581,12 +581,12 @@ TableViewLastColumnResizingFixer::TableViewLastColumnResizingFixer(QTableView* t
581
581
#ifdef WIN32
582
582
boost::filesystem::path static StartupShortcutPath ()
583
583
{
584
- if (GetBoolArg (" -testnet" , false ))
584
+ std::string chain = ChainNameFromCommandLine ();
585
+ if (chain == CBaseChainParams::MAIN)
586
+ return GetSpecialFolderPath (CSIDL_STARTUP) / " Bitcoin.lnk" ;
587
+ if (chain == CBaseChainParams::TESTNET) // Remove this special case when CBaseChainParams::TESTNET = "testnet4"
585
588
return GetSpecialFolderPath (CSIDL_STARTUP) / " Bitcoin (testnet).lnk" ;
586
- else if (GetBoolArg (" -regtest" , false ))
587
- return GetSpecialFolderPath (CSIDL_STARTUP) / " Bitcoin (regtest).lnk" ;
588
-
589
- return GetSpecialFolderPath (CSIDL_STARTUP) / " Bitcoin.lnk" ;
589
+ return GetSpecialFolderPath (CSIDL_STARTUP) / strprintf (" Bitcoin (%s).lnk" , chain);
590
590
}
591
591
592
592
bool GetStartOnSystemStartup ()
@@ -719,15 +719,14 @@ bool SetStartOnSystemStartup(bool fAutoStart)
719
719
boost::filesystem::ofstream optionFile (GetAutostartFilePath (), std::ios_base::out|std::ios_base::trunc);
720
720
if (!optionFile.good ())
721
721
return false ;
722
+ std::string chain = ChainNameFromCommandLine ();
722
723
// Write a bitcoin.desktop file to the autostart directory:
723
724
optionFile << " [Desktop Entry]\n " ;
724
725
optionFile << " Type=Application\n " ;
725
- if (GetBoolArg (" -testnet" , false ))
726
- optionFile << " Name=Bitcoin (testnet)\n " ;
727
- else if (GetBoolArg (" -regtest" , false ))
728
- optionFile << " Name=Bitcoin (regtest)\n " ;
729
- else
726
+ if (chain == CBaseChainParams::MAIN)
730
727
optionFile << " Name=Bitcoin\n " ;
728
+ else
729
+ optionFile << strprintf (" Name=Bitcoin (%s)\n " , chain);
731
730
optionFile << " Exec=" << pszExePath << strprintf (" -min -testnet=%d -regtest=%d\n " , GetBoolArg (" -testnet" , false ), GetBoolArg (" -regtest" , false ));
732
731
optionFile << " Terminal=false\n " ;
733
732
optionFile << " Hidden=false\n " ;
0 commit comments