diff --git a/.travis.yml b/.travis.yml index 3cc2f5849..b93ed982c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -108,7 +108,7 @@ deploy: secure: "U0Dt2CXrcG8Yi4taUCT/6AnM+0IJtdCv6IVG/2rGooUY3pZjNWE9XDM6X9ZeAmbI79aN6FPTppjUf3KbB/upYeJt+8mrjnxEk/ZTO1xXDDW8iL/DiqnczoFsMGmPsTM+Fkeak8bu0SifI7Qkx9i1N+zOyl2VdlaxGjchPfl/OJw2jcQs7rOGRfr23/rapZKTcFq+BFlxMiIHa0dXbCJ9vagdlyAeclOCtPjw1VoH/Cb/+0/Xlx2MFPncw4/1P+bO/fPantHyehh3/WCDVCnI4M7ftONpsTVRrQ+Hml89teUH9/1xXUOpbCeVghWr1rumLcQzMqLKNj2lP/gm9co2/DKpxiUPUzBfO/9Jvl1CNoEwPYQBRNb38kggDvAT4vKX38Oi5sZvumFEO4L0y7o4cW6SA4/CYIykfxOdkrryt8ltfWwopdy3I/DothYw31vJ9GsZOCAShFRAy3hJxYUbHhT+7SDUBadVSEkb4UqxQ+7zntAVT+Lp4DXLAfvsWxZGrQoP/IrWAgNOLRKILubpzh+YpadMH3Ygha2JRAeJAEZ3DnXf3vOOAucWnk4mNXDbW35GTDTAJDWMvddZCfsrUI/uHxgaRjFs9fLX1X5tqhGnsr27sKLWyX+zrIPVV0TPl3AzYPAf6Bc8Okeu+JEGQERvvgSasCuYcmhgYznBVJI=" file_glob: true file: - - "NetHack-x86-beta$TRAVIS_TAG.zip" + - "$TRAVIS_TAG.x86.zip" skip_cleanup: true on: tags: true diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 7777ed29d..1e85d7e02 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,4 @@ -.\" $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.312 $ $NHDT-Date: 1562838836 2019/07/11 09:53:56 $ +.\" $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.317 $ $NHDT-Date: 1572448817 2019/10/30 15:20:17 $ .\" .\" This is an excerpt from the 'roff' man page from the 'groff' package. .\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines. @@ -2642,6 +2642,7 @@ of which can be used multiple times. In general, the statements are written in capital letters, followed by an equals sign, followed by settings particular to that statement. +.pg Here is a list of allowed statements: .lp OPTIONS There are two types of options, boolean and compound options. @@ -2653,7 +2654,7 @@ Some options are persistent, and apply only to new games. You can specify multiple OPTIONS statements, and multiple options separated by commas in a single OPTIONS statement. (Comma separated options are processed from right to left.) -.pg +.lp "" Example: .sd .ft CR @@ -2682,6 +2683,7 @@ HACKDIR, must be writable. .lp TROUBLEDIR The location that a record of game aborts and self-diagnosed game problems is kept. Defaults to HACKDIR, must be writable. +.\" config file entries beyond this point are shown alphabetically .lp AUTOCOMPLETE Enable or disable an extended command autocompletion. Autocompletion has no effect for the X11 windowport. @@ -2689,7 +2691,7 @@ You can specify multiple autocompletions. To enable autocompletion, list the extended command. Prefix the command with \(lq!\(rq to disable the autocompletion for that command. -.pg +.lp "" Example: .sd \f(CRAUTOCOMPLETE=zap,!annotate\fP @@ -2705,7 +2707,7 @@ extended commands. You can specify multiple bindings. Format is key followed by the command, separated by a colon. See the \(lqChanging Key Bindings\(rq section for more information. -.pg +.lp "" Example: .sd \f(CRBIND=\(haX:getpos.autodescribe\fP @@ -2713,7 +2715,7 @@ Example: .lp CHOOSE Chooses at random one of the comma-separated parameters as an active section name. Lines in other sections are ignored. -.pg +.lp "" Example: .sd .ft CR \" constant-width Roman @@ -2725,37 +2727,43 @@ OPTIONS=role:arc,race:dwa,align:law,gender:fem OPTIONS=role:wiz,race:elf,align:cha,gender:mal .ft \" revert to previous font .ed -.lp MSGTYPE -Change the way messages are shown in the top status line. -See the \(lqConfiguring Message Types\(rq section. .lp MENUCOLOR Highlight menu lines with different colors. See the \(lqConfiguring Menu Colors\(rq section. -.lp SYMBOLS, ROGUESYMBOLS -Override one or more symbols in the symbols files. +.lp MSGTYPE +Change the way messages are shown in the top status line. +See the \(lqConfiguring Message Types\(rq section. +.lp ROGUESYMBOLS +Custom symbols for for the rogue level's symbol set. +See \fISYMBOLS\fP below. +.lp SOUND +Define a sound mapping. +See the \(lqConfiguring User Sounds\(rq section. +.lp SOUNDDIR +Define the directory that contains the sound files. +See the \(lqConfiguring User Sounds\(rq section. +.lp SYMBOLS +Override one or more symbols in the symbol set used for all dungeon +levels except for the special rogue level. See the \(lqModifying NetHack Symbols\(rq section. -.pg +.lp "" Example: .sd -\f(CRSYMBOLS=S_boulder:0\fP +\f(CR# replace small punctuation (tick marks) with easier to see digits\fP +\f(CRSYMBOLS=S_boulder:0,S_golem:7\fP .ed .lp WIZKIT Debug mode only: extra items to add to initial inventory. Value is the name of a text file containing a list of item names, one per line, up to a maximum of 128 lines. Each line is processed by the function that handles wishing. -.pg +.lp "" Example: .sd \f(CRWIZKIT=\(ti/wizkit.txt\fP \" \(ti == '~' .ed -.lp SOUNDDIR -Define the directory that contains the sound files. -See the \(lqConfiguring User Sounds\(rq section. -.lp SOUND -Define a sound mapping. -See the \(lqConfiguring User Sounds\(rq section. -.pg +.lp "" +.pg \" this would look better outdented Here is a short example of config file contents: .sd .ft CR \" set font to constant-width Roman @@ -4373,7 +4381,8 @@ Set the name of the symbol set that you want to load for display on the rogue level. .pg You can also override one or more symbols using the SYMBOLS and -ROGUESYMBOLS config file options. Symbols are specified as name:value pairs. +ROGUESYMBOLS config file options. +Symbols are specified as name:value pairs. Note that NetHack escape-processes the value string in conventional C fashion. This means that \\ is a prefix to take the following character literally. @@ -4613,8 +4622,8 @@ After you have gained some experience with the game and with editing files, you may want to alter settings via \fBSYMBOLS=\fP and \fBROGUESYMBOLS=\fP in your configuration file to better suit your preferences. -See the previous section for the special symbols S_pet_override -to force a consistent symbol for all pets and and +See the previous section for the special symbols S_pet_override +to force a consistent symbol for all pets and S_player_override to force a unique symbol for the player character if \fBaccessibility\fP is enabled in the sysconf file. The most crucial settings to make the game accessible are: diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index a82a3895e..553862907 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2866,13 +2866,22 @@ for system administrators. \subsection*{Using a configuration file} %.pg -The default name of the configuration file varies on different -operating systems. On MS-DOS and Windows, it is \mbox{``defaults.nh''} in +The default name and location of the configuration file varies on different +operating systems. If you manually installed on MS-DOS and Windows, +it is \mbox{``defaults.nh''} in the same folder as \mbox{{\it nethack.exe\/}} or \mbox{{\it nethackW.exe\/}}. +If you installed using the Microsoft Store, it is \mbox{``defaults.nh''} in +the folder \mbox{{``\%USERPROFILE\%\textbackslash NetHack''}}. On Unix, Linux and Mac OS X it is \mbox{``.nethackrc''} in the user's home directory. The file may not exist, but it is a normal ASCII text file and can be created with any text editor. +%.pg +If you installed using the Microsoft Store, you will find that we provide +a starting template for you to use to create your \mbox{``defaults.nh''} +configuration file. It is \mbox{``defaults.tmp''} also in the folder +\mbox{{``\%USERPROFILE\%\textbackslash NetHack''}}. + %.pg Any line in the configuration file starting with `{\tt \#}' is treated as a comment. Empty lines are ignored. @@ -4867,10 +4876,10 @@ on the rogue level. \elist You can also override one or more symbols using the {\it SYMBOLS\/} and -{\it ROGUESYMBOLS\/} config file options. Symbols are specified as -{\it name:value\/} pairs. Note that {\it NetHack\/} escape-processes -the {\it value\/} string in conventional C fashion. This means that `\verb+\+' -is a prefix to take the following character literally. Thus `\verb+\+' needs +{\it ROGUESYMBOLS\/} config file options. Symbols are specified as +{\it name:value\/} pairs. Note that {\it NetHack\/} escape-processes +the {\it value\/} string in conventional C fashion. This means that `\verb+\+' +is a prefix to take the following character literally. Thus `\verb+\+' needs to be represented as `\verb+\\+'. The special prefix `\verb+\m+' switches on the meta bit in the symbol value, and the diff --git a/include/extern.h b/include/extern.h index 243a5d44c..93b5f63d8 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1824,6 +1824,8 @@ E int NDECL(dohistory); E void FDECL(chdirx, (char *, BOOLEAN_P)); #endif /* CHDIR */ E boolean NDECL(authorize_wizard_mode); +E boolean NDECL(is_desktop_bridge_application); + #endif /* MICRO || WIN32 */ /* ### pcsys.c ### */ diff --git a/include/ntconf.h b/include/ntconf.h index c2b0b3af0..a94ba3579 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -284,4 +284,5 @@ extern void FDECL(nhassert_failed, (const char * exp, const char * file, #define nethack_enter(argc, argv) nethack_enter_winnt() extern void FDECL(nethack_exit, (int)) NORETURN; extern boolean FDECL(file_exists, (const char *)); +extern boolean FDECL(file_newer, (const char *, const char *)); #endif /* NTCONF_H */ diff --git a/src/files.c b/src/files.c index 6b7c791b0..e543c9b71 100644 --- a/src/files.c +++ b/src/files.c @@ -1371,6 +1371,10 @@ get_saved_games() { char *foundfile; const char *fq_save; + const char *fq_new_save; + const char *fq_old_save; + char **files = 0; + int i; Strcpy(g.plname, "*"); set_savefile_name(FALSE); @@ -1386,20 +1390,44 @@ get_saved_games() ++n; } while (findnext()); } + if (n > 0) { - result = (char **) alloc((n + 1) * sizeof(char *)); /* at most */ - (void) memset((genericptr_t) result, 0, (n + 1) * sizeof(char *)); + files = (char **) alloc((n + 1) * sizeof(char *)); /* at most */ + (void) memset((genericptr_t) files, 0, (n + 1) * sizeof(char *)); if (findfirst((char *) fq_save)) { - j = n = 0; + i = 0; do { - char *r; - r = plname_from_file(foundfile); - if (r) - result[j++] = r; - ++n; + files[i++] = strdup(foundfile); } while (findnext()); } } + + if (n > 0) { + result = (char **) alloc((n + 1) * sizeof(char *)); /* at most */ + (void) memset((genericptr_t) result, 0, (n + 1) * sizeof(char *)); + for(i = 0; i < n; i++) { + char *r; + r = plname_from_file(files[i]); + + if (r) { + + /* rename file if it is not named as expected */ + Strcpy(g.plname, r); + set_savefile_name(FALSE); + fq_new_save = fqname(g.SAVEF, SAVEPREFIX, 0); + fq_old_save = fqname(files[i], SAVEPREFIX, 1); + + if(strcmp(fq_old_save, fq_new_save) != 0 && + !file_exists(fq_new_save)) + rename(fq_old_save, fq_new_save); + + result[j++] = r; + } + } + } + + free_saved_games(files); + } #endif #if defined(UNIX) && defined(QT_GRAPHICS) @@ -3400,6 +3428,7 @@ fopen_sym_file() FILE *fp; fp = fopen_datafile(SYMBOLS, "r", HACKPREFIX); + return fp; } diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 7954b30c2..6eeb814bb 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -540,7 +540,8 @@ guilflags = $(lflags) -subsystem:windows,$(EXEVER) dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll # basic subsystem specific libraries, less the C Run-Time -baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib gdi32.lib +baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib gdi32.lib \ + ole32.lib Shell32.lib winlibs = $(baselibs) user32.lib comdlg32.lib winspool.lib # for Windows applications that use the C Run-Time libraries diff --git a/sys/winnt/windmain.c b/sys/winnt/windmain.c index 1f5264670..00d64e24c 100644 --- a/sys/winnt/windmain.c +++ b/sys/winnt/windmain.c @@ -8,8 +8,11 @@ #include "hack.h" #include "dlb.h" #include +#include #include #include +#include +#include #if 0 #include "wintty.h" @@ -22,7 +25,7 @@ #define E extern static void FDECL(process_options, (int argc, char **argv)); static void NDECL(nhusage); -static char *FDECL(exepath, (char *)); +static char *NDECL(get_executable_path); char *NDECL(exename); boolean NDECL(fakeconsole); void NDECL(freefakeconsole); @@ -49,7 +52,6 @@ extern int NDECL(windows_console_custom_nhgetch); void NDECL(safe_routines); char orgdir[PATHLEN]; -char *dir; boolean getreturn_enabled; extern int redirect_stdout; /* from sys/share/pcsys.c */ extern int GUILaunched; @@ -66,6 +68,279 @@ static struct stat hbuf; extern char orgdir[]; +boolean +is_desktop_bridge_application() +{ + UINT32 length = 0; + LONG rc = GetCurrentPackageFullName(&length, NULL); + + return (rc == ERROR_INSUFFICIENT_BUFFER); +} + +void +get_known_folder_path( + const KNOWNFOLDERID * folder_id, + char * path + , size_t path_size) +{ + PWSTR wide_path; + if (FAILED(SHGetKnownFolderPath(folder_id, 0, NULL, &wide_path))) + error("Unable to get known folder path"); + + size_t converted; + errno_t err; + + err = wcstombs_s(&converted, path, path_size, wide_path, path_size - 1); + + CoTaskMemFree(wide_path); + + if (err != 0) error("Failed folder path string conversion"); +} + +void +create_directory(const char * path) +{ + HRESULT hr = CreateDirectoryA(path, NULL); + + if (FAILED(hr) && hr != ERROR_ALREADY_EXISTS) + error("Unable to create directory '%s'", path); +} + +void +build_known_folder_path( + const KNOWNFOLDERID * folder_id, + char * path, + size_t path_size) +{ + get_known_folder_path(folder_id, path, path_size); + strcat(path, "\\NetHack\\"); + create_directory(path); + strcat(path, "3.6\\"); + create_directory(path); +} + +void +build_environment_path( + const char * env_str, + const char * folder, + char * path, + size_t path_size) +{ + path[0] = '\0'; + + const char * root_path = nh_getenv(env_str); + + if (root_path == NULL) return; + + strcpy_s(path, path_size, root_path); + + char * colon = index(path, ';'); + if (colon != NULL) path[0] = '\0'; + + if (strlen(path) == 0) return; + + append_slash(path); + + if (folder != NULL) { + strcat_s(path, path_size, folder); + strcat_s(path, path_size, "\\"); + } +} + +boolean +folder_file_exists(const char * folder, const char * file_name) +{ + char path[MAX_PATH]; + + if (folder[0] == '\0') return FALSE; + + strcpy(path, folder); + strcat(path, file_name); + return file_exists(path); +} + +/* + * Rules for setting prefix locations + * + * COMMON_NETHACK_PATH = %COMMONPROGRAMFILES%\NetHack\3.6\ + * PROFILE_PATH = %SystemDrive%\Users\%USERNAME%\ + * + * NETHACK_PROFILE_PATH = PROFILE_PATH\NetHack\3.6\ + * NETHACK_PER_USER_DATA_PATH = PROFILE_PATH\AppData\Local\NetHack\3.6\ + * NETHACK_GLOBAL_DATA_PATH = %SystemDrive%\ProgramData\NetHack\3.6\ + * EXECUTABLE_PATH = path to where .exe lives + * + * HACKPREFIX: + * - use environment variable NETHACKDIR if variable is defined + * - otherwise use environment variable HACKDIR if variable is defined + * - otherwise if store install use NETHACK_PROFILE_PATH + * - otherwise if manual install use EXECUTABLE_PATH + * + * LEVELPREFIX, SAVEPREFIX: + * - if store install use NETHACK_PER_USER_DATA_PATH + * - if manual install use HACKPREFIX + * + * BONESPREFIX, SCOREPREFIX, LOCKPREFIX: + * - if store install use NETHACK_GLOBAL_DATA_PATH + * - if manual install use HACKPREFIX + * + * DATAPREFIX + * - if store install use EXECUTABLE_PATH + * - if manual install use HACKPREFIX + * + * SYSCONFPREFIX + * - use COMMON_NETHACK_PATH if sysconf present + * - otherwise use HACKPREFIX + * + * CONFIGPREFIX + * - if manual install use PROFILE_PATH + * - if store install use NETHACK_PROFILE_PATH + */ + +void +set_default_prefix_locations(const char *programPath) +{ + char *envp = NULL; + char *sptr = NULL; + + static char hack_path[MAX_PATH]; + static char executable_path[MAX_PATH]; + static char nethack_profile_path[MAX_PATH]; + static char nethack_per_user_data_path[MAX_PATH]; + static char nethack_global_data_path[MAX_PATH]; + static char sysconf_path[MAX_PATH]; + + strcpy(executable_path, get_executable_path()); + append_slash(executable_path); + + build_environment_path("NETHACKDIR", NULL, hack_path, sizeof(hack_path)); + + if (hack_path[0] == '\0') + build_environment_path("HACKDIR", NULL, hack_path, sizeof(hack_path)); + + build_known_folder_path(&FOLDERID_Profile, nethack_profile_path, + sizeof(nethack_profile_path)); + + build_known_folder_path(&FOLDERID_LocalAppData, + nethack_per_user_data_path, sizeof(nethack_per_user_data_path)); + + build_known_folder_path(&FOLDERID_ProgramData, + nethack_global_data_path, sizeof(nethack_global_data_path)); + + if (hack_path[0] == '\0') + strcpy(hack_path, nethack_profile_path); + + g.fqn_prefix[LEVELPREFIX] = nethack_per_user_data_path; + g.fqn_prefix[SAVEPREFIX] = nethack_per_user_data_path; + g.fqn_prefix[BONESPREFIX] = nethack_global_data_path; + g.fqn_prefix[DATAPREFIX] = executable_path; + g.fqn_prefix[SCOREPREFIX] = nethack_global_data_path; + g.fqn_prefix[LOCKPREFIX] = nethack_global_data_path; + g.fqn_prefix[CONFIGPREFIX] = nethack_profile_path; + + g.fqn_prefix[HACKPREFIX] = hack_path; + g.fqn_prefix[TROUBLEPREFIX] = hack_path; + + build_environment_path("COMMONPROGRAMFILES", "NetHack\\3.6", sysconf_path, + sizeof(sysconf_path)); + + if(!folder_file_exists(sysconf_path, SYSCF_FILE)) + strcpy(sysconf_path, hack_path); + + g.fqn_prefix[SYSCONFPREFIX] = sysconf_path; + +} + +/* copy file if destination does not exist */ +void +copy_file( + const char * dst_folder, + const char * dst_name, + const char * src_folder, + const char * src_name) +{ + char dst_path[MAX_PATH]; + strcpy(dst_path, dst_folder); + strcat(dst_path, dst_name); + + char src_path[MAX_PATH]; + strcpy(src_path, src_folder); + strcat(src_path, src_name); + + if(!file_exists(src_path)) + error("Unable to copy file '%s' as it does not exist", src_path); + + if(file_exists(dst_path)) + return; + + BOOL success = CopyFileA(src_path, dst_path, TRUE); + if(!success) error("Failed to copy '%s' to '%s'", src_path, dst_path); +} + +/* update file copying if it does not exist or src is newer then dst */ +void +update_file( + const char * dst_folder, + const char * dst_name, + const char * src_folder, + const char * src_name) +{ + char dst_path[MAX_PATH]; + strcpy(dst_path, dst_folder); + strcat(dst_path, dst_name); + + char src_path[MAX_PATH]; + strcpy(src_path, src_folder); + strcat(src_path, src_name); + + if(!file_exists(src_path)) + error("Unable to copy file '%s' as it does not exist", src_path); + + if (!file_newer(src_path, dst_path)) + return; + + BOOL success = CopyFileA(src_path, dst_path, FALSE); + if(!success) error("Failed to update '%s' to '%s'", src_path, dst_path); + +} + +void copy_config_content() +{ + /* Keep templates up to date */ + update_file(g.fqn_prefix[CONFIGPREFIX], "defaults.tmp", + g.fqn_prefix[DATAPREFIX], "defaults.nh"); + update_file(g.fqn_prefix[SYSCONFPREFIX], "sysconf.tmp", + g.fqn_prefix[DATAPREFIX], SYSCF_FILE); + + /* If the required early game file does not exist, copy it */ + copy_file(g.fqn_prefix[CONFIGPREFIX], "defaults.nh", + g.fqn_prefix[DATAPREFIX], "defaults.nh"); + copy_file(g.fqn_prefix[SYSCONFPREFIX], SYSCF_FILE, + g.fqn_prefix[DATAPREFIX], SYSCF_FILE); + + /* If a required game file does not exist, copy it */ + /* TODO: Can't HACKDIR be changed during option parsing + causing us to perhaps be checking options against the wrong + symbols file? */ + copy_file(g.fqn_prefix[HACKPREFIX], SYMBOLS, + g.fqn_prefix[DATAPREFIX], SYMBOLS); +} + +void +copy_hack_content() +{ + /* Keep Guidebook and opthelp up to date */ + update_file(g.fqn_prefix[HACKPREFIX], "Guidebook.txt", + g.fqn_prefix[DATAPREFIX], "Guidebook.txt"); + update_file(g.fqn_prefix[HACKPREFIX], "opthelp", + g.fqn_prefix[DATAPREFIX], "opthelp"); + + /* Keep templates up to date */ + update_file(g.fqn_prefix[HACKPREFIX], "symbols.tmp", + g.fqn_prefix[DATAPREFIX], "symbols"); + +} + /* * __MINGW32__ Note * If the graphics version is built, we don't need a main; it is skipped @@ -119,110 +394,25 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ #endif g.hname = "NetHack"; /* used for syntax messages */ + +#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) /* Save current directory and make sure it gets restored when * the game is exited. */ if (getcwd(orgdir, sizeof orgdir) == (char *) 0) error("NetHack: current directory path too long"); - dir = nh_getenv("NETHACKDIR"); - if (dir == (char *) 0) - dir = nh_getenv("HACKDIR"); - if (dir == (char *) 0) - dir = exepath(argv[0]); -#ifdef _MSC_VER - if (IsDebuggerPresent()) { - static char exepath[_MAX_PATH]; - /* check if we're running under the debugger so we can get to the right folder anyway */ - if (dir != (char *)0) { - char *top = (char *)0; - - if (strlen(dir) < (_MAX_PATH - 1)) - strcpy(exepath, dir); - top = strstr(exepath, "\\build\\.\\Debug"); - if (!top) top = strstr(exepath, "\\build\\.\\Release"); - if (top) { - *top = '\0'; - if (strlen(exepath) < (_MAX_PATH - (strlen("\\binary\\") + 1))) { - Strcat(exepath, "\\binary\\"); - if (strlen(exepath) < (PATHLEN - 1)) { - dir = exepath; - } - } - } - } - } #endif - if (dir != (char *)0) { - int prefcnt; - int fd; - boolean have_syscf = FALSE; - (void) strncpy(g.hackdir, dir, PATHLEN - 1); - g.hackdir[PATHLEN - 1] = '\0'; - g.fqn_prefix[0] = (char *) alloc(strlen(g.hackdir) + 2); - Strcpy(g.fqn_prefix[0], g.hackdir); - append_slash(g.fqn_prefix[0]); - for (prefcnt = 1; prefcnt < PREFIX_COUNT; prefcnt++) - g.fqn_prefix[prefcnt] = g.fqn_prefix[0]; - /* sysconf should be searched for in this location */ - envp = nh_getenv("COMMONPROGRAMFILES"); - if (envp) { - if ((sptr = index(envp, ';')) != 0) - *sptr = '\0'; - if (strlen(envp) > 0) { - g.fqn_prefix[SYSCONFPREFIX] = - (char *) alloc(strlen(envp) + 10); - Strcpy(g.fqn_prefix[SYSCONFPREFIX], envp); - append_slash(g.fqn_prefix[SYSCONFPREFIX]); - Strcat(g.fqn_prefix[SYSCONFPREFIX], "NetHack\\"); - } - } + set_default_prefix_locations(argv[0]); - /* okay so we have the overriding and definitive locaton - for sysconf, but only in the event that there is not a - sysconf file there (for whatever reason), check a secondary - location rather than abort. */ +#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) + chdir(fqn_prefix[HACKPREFIX]); +#endif - /* Is there a SYSCF_FILE there? */ - fd = open(fqname(SYSCF_FILE, SYSCONFPREFIX, 0), O_RDONLY); - if (fd >= 0) { - /* readable */ - close(fd); - have_syscf = TRUE; - } + copy_config_content(); - if (!have_syscf) { - /* No SYSCF_FILE where there should be one, and - without an installer, a user may not be able - to place one there. So, let's try somewhere else... */ - g.fqn_prefix[SYSCONFPREFIX] = g.fqn_prefix[0]; - - /* Is there a SYSCF_FILE there? */ - fd = open(fqname(SYSCF_FILE, SYSCONFPREFIX, 0), O_RDONLY); - if (fd >= 0) { - /* readable */ - close(fd); - have_syscf = TRUE; - } - } - - /* user's home directory should default to this - unless - * overridden */ - envp = nh_getenv("USERPROFILE"); - if (envp) { - if ((sptr = index(envp, ';')) != 0) - *sptr = '\0'; - if (strlen(envp) > 0) { - g.fqn_prefix[CONFIGPREFIX] = - (char *) alloc(strlen(envp) + 2); - Strcpy(g.fqn_prefix[CONFIGPREFIX], envp); - append_slash(g.fqn_prefix[CONFIGPREFIX]); - } - } - } - if (GUILaunched || IsDebuggerPresent()) { + if (GUILaunched || IsDebuggerPresent()) getreturn_enabled = TRUE; - } check_recordfile((char *) 0); iflags.windowtype_deferred = TRUE; @@ -232,10 +422,11 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ failbuf); nethack_exit(EXIT_FAILURE); } - if (!g.hackdir[0]) - Strcpy(g.hackdir, orgdir); + process_options(argc, argv); - + + copy_hack_content(); + /* * It seems you really want to play. */ @@ -291,10 +482,8 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ setting of renameallowed; when False, player_selection() won't resent renaming as an option */ iflags.renameallowed = FALSE; -#if 0 /* Obtain the name of the logged on user and incorporate * it into the name. */ -#endif Sprintf(fnamebuf, "%s", g.plname); (void) fname_encode( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-.", '%', @@ -402,7 +591,7 @@ char *argv[]; */ argc--; argv++; - dir = argv[0] + 2; + const char * dir = argv[0] + 2; if (*dir == '=' || *dir == ':') dir++; if (!*dir && argc > 1) { @@ -665,33 +854,28 @@ void freefakeconsole() } #endif -#define EXEPATHBUFSZ 256 -char exepathbuf[EXEPATHBUFSZ]; - char * -exepath(str) -char *str; +get_executable_path() { - char *tmp, *tmp2; - int bsize; + static char path_buffer[MAX_PATH]; - if (!str) - return (char *) 0; - bsize = EXEPATHBUFSZ; - tmp = exepathbuf; #ifdef UNICODE { TCHAR wbuf[BUFSZ]; GetModuleFileName((HANDLE) 0, wbuf, BUFSZ); - WideCharToMultiByte(CP_ACP, 0, wbuf, -1, tmp, bsize, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, wbuf, -1, path_buffer, sizeof(path_buffer), NULL, NULL); } #else - *(tmp + GetModuleFileName((HANDLE) 0, tmp, bsize)) = '\0'; + DWORD length = GetModuleFileName((HANDLE) 0, path_buffer, MAX_PATH); + if (length == ERROR_INSUFFICIENT_BUFFER) error("Unable to get module name"); + path_buffer[length] = '\0'; #endif - tmp2 = strrchr(tmp, PATH_SEPARATOR); - if (tmp2) - *tmp2 = '\0'; - return tmp; + + char * seperator = strrchr(path_buffer, PATH_SEPARATOR); + if (seperator) + *seperator = '\0'; + + return path_buffer; } /*ARGSUSED*/ @@ -932,4 +1116,28 @@ const char *path; return TRUE; } +/* + file_newer returns TRUE if the file at a_path is newer then the file + at b_path. If a_path does not exist, it returns FALSE. If b_path + does not exist, it returns TRUE. + */ +boolean +file_newer(a_path, b_path) +const char * a_path; +const char * b_path; +{ + struct stat a_sb; + struct stat b_sb; + + if (stat(a_path, &a_sb)) + return FALSE; + + if (stat(b_path, &b_sb)) + return TRUE; + + if(difftime(a_sb.st_mtime, b_sb.st_mtime) < 0) + return TRUE; + return FALSE; +} + /*windmain.c*/ diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index f06775a4b..4f1d29dea 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -188,15 +188,21 @@ get_username(lan_username_size) int *lan_username_size; { static TCHAR username_buffer[BUFSZ]; - unsigned int status; DWORD i = BUFSZ - 1; - /* i gets updated with actual size */ - status = GetUserName(username_buffer, &i); - if (status) - username_buffer[i] = '\0'; - else - Strcpy(username_buffer, "NetHack"); + Strcpy(username_buffer, "NetHack"); + + /* Our privacy policy for the windows store version of nethack makes + * a promise about not collecting any personally identifiable information. + * Do not allow getting user name if we being run from windows store + * version of nethack. In 3.7, we should remove use of username. + */ + if (!is_desktop_bridge_application()) { + /* i gets updated with actual size */ + if (GetUserName(username_buffer, &i)) + username_buffer[i] = '\0'; + } + if (lan_username_size) *lan_username_size = strlen(username_buffer); return username_buffer; diff --git a/win/win32/mhsplash.c b/win/win32/mhsplash.c index 0271c8081..8dcfd1b39 100644 --- a/win/win32/mhsplash.c +++ b/win/win32/mhsplash.c @@ -170,6 +170,7 @@ mswin_display_splash_window(BOOL show_ver) FILE *nf; iflags.news = 0; /* prevent newgame() from re-displaying news */ + /* BUG: this relies on current working directory */ nf = fopen(NEWS, "r"); if (nf != NULL) { char line[LLEN + 1]; diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 1d9907b42..df7fc4432 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -142,6 +142,7 @@ mswin_init_nhwindows(int *argc, char **argv) # ifdef _DEBUG if (showdebug(NHTRACE_LOG) && !_s_debugfp) { /* truncate trace file */ + /* BUG: this relies on current working directory */ _s_debugfp = fopen(NHTRACE_LOG, "w"); } # endif diff --git a/win/win32/vs2017/.gitignore b/win/win32/vs2017/.gitignore index f87237325..c4775b3c5 100644 --- a/win/win32/vs2017/.gitignore +++ b/win/win32/vs2017/.gitignore @@ -2,3 +2,11 @@ *.db-shm *.db-wal paniclog +_pkginfo.txt +AppPackages +BundleArtifacts +report.xml +*.cer +*.appxbundle +NetHackPackage_StoreKey.pfx +NetHackPackage_TemporaryKey.pfx diff --git a/win/win32/vs2017/Images/BadgeLogo.scale-100.png b/win/win32/vs2017/Images/BadgeLogo.scale-100.png new file mode 100644 index 000000000..0c1dff1b4 Binary files /dev/null and b/win/win32/vs2017/Images/BadgeLogo.scale-100.png differ diff --git a/win/win32/vs2017/Images/BadgeLogo.scale-125.png b/win/win32/vs2017/Images/BadgeLogo.scale-125.png new file mode 100644 index 000000000..45aa7773c Binary files /dev/null and b/win/win32/vs2017/Images/BadgeLogo.scale-125.png differ diff --git a/win/win32/vs2017/Images/BadgeLogo.scale-150.png b/win/win32/vs2017/Images/BadgeLogo.scale-150.png new file mode 100644 index 000000000..6a911cb2a Binary files /dev/null and b/win/win32/vs2017/Images/BadgeLogo.scale-150.png differ diff --git a/win/win32/vs2017/Images/BadgeLogo.scale-200.png b/win/win32/vs2017/Images/BadgeLogo.scale-200.png new file mode 100644 index 000000000..21e20fb67 Binary files /dev/null and b/win/win32/vs2017/Images/BadgeLogo.scale-200.png differ diff --git a/win/win32/vs2017/Images/BadgeLogo.scale-400.png b/win/win32/vs2017/Images/BadgeLogo.scale-400.png new file mode 100644 index 000000000..10fdb8f1e Binary files /dev/null and b/win/win32/vs2017/Images/BadgeLogo.scale-400.png differ diff --git a/win/win32/vs2017/Images/LargeTile.scale-100.png b/win/win32/vs2017/Images/LargeTile.scale-100.png new file mode 100644 index 000000000..2c00fc94e Binary files /dev/null and b/win/win32/vs2017/Images/LargeTile.scale-100.png differ diff --git a/win/win32/vs2017/Images/LargeTile.scale-125.png b/win/win32/vs2017/Images/LargeTile.scale-125.png new file mode 100644 index 000000000..fb1ba8d8e Binary files /dev/null and b/win/win32/vs2017/Images/LargeTile.scale-125.png differ diff --git a/win/win32/vs2017/Images/LargeTile.scale-150.png b/win/win32/vs2017/Images/LargeTile.scale-150.png new file mode 100644 index 000000000..f3ccd1107 Binary files /dev/null and b/win/win32/vs2017/Images/LargeTile.scale-150.png differ diff --git a/win/win32/vs2017/Images/LargeTile.scale-200.png b/win/win32/vs2017/Images/LargeTile.scale-200.png new file mode 100644 index 000000000..0c40a8a72 Binary files /dev/null and b/win/win32/vs2017/Images/LargeTile.scale-200.png differ diff --git a/win/win32/vs2017/Images/LargeTile.scale-400.png b/win/win32/vs2017/Images/LargeTile.scale-400.png new file mode 100644 index 000000000..5c11c508b Binary files /dev/null and b/win/win32/vs2017/Images/LargeTile.scale-400.png differ diff --git a/win/win32/vs2017/Images/LockScreenLogo.scale-200.png b/win/win32/vs2017/Images/LockScreenLogo.scale-200.png new file mode 100644 index 000000000..735f57adb Binary files /dev/null and b/win/win32/vs2017/Images/LockScreenLogo.scale-200.png differ diff --git a/win/win32/vs2017/Images/SmallTile.scale-100.png b/win/win32/vs2017/Images/SmallTile.scale-100.png new file mode 100644 index 000000000..f7e719d06 Binary files /dev/null and b/win/win32/vs2017/Images/SmallTile.scale-100.png differ diff --git a/win/win32/vs2017/Images/SmallTile.scale-125.png b/win/win32/vs2017/Images/SmallTile.scale-125.png new file mode 100644 index 000000000..e5aa2ea1b Binary files /dev/null and b/win/win32/vs2017/Images/SmallTile.scale-125.png differ diff --git a/win/win32/vs2017/Images/SmallTile.scale-150.png b/win/win32/vs2017/Images/SmallTile.scale-150.png new file mode 100644 index 000000000..57d16d648 Binary files /dev/null and b/win/win32/vs2017/Images/SmallTile.scale-150.png differ diff --git a/win/win32/vs2017/Images/SmallTile.scale-200.png b/win/win32/vs2017/Images/SmallTile.scale-200.png new file mode 100644 index 000000000..5e5e0ece8 Binary files /dev/null and b/win/win32/vs2017/Images/SmallTile.scale-200.png differ diff --git a/win/win32/vs2017/Images/SmallTile.scale-400.png b/win/win32/vs2017/Images/SmallTile.scale-400.png new file mode 100644 index 000000000..3ed4e6994 Binary files /dev/null and b/win/win32/vs2017/Images/SmallTile.scale-400.png differ diff --git a/win/win32/vs2017/Images/SplashScreen.scale-100.png b/win/win32/vs2017/Images/SplashScreen.scale-100.png new file mode 100644 index 000000000..d4bab84e3 Binary files /dev/null and b/win/win32/vs2017/Images/SplashScreen.scale-100.png differ diff --git a/win/win32/vs2017/Images/SplashScreen.scale-125.png b/win/win32/vs2017/Images/SplashScreen.scale-125.png new file mode 100644 index 000000000..d97a15fc2 Binary files /dev/null and b/win/win32/vs2017/Images/SplashScreen.scale-125.png differ diff --git a/win/win32/vs2017/Images/SplashScreen.scale-150.png b/win/win32/vs2017/Images/SplashScreen.scale-150.png new file mode 100644 index 000000000..2ce132a50 Binary files /dev/null and b/win/win32/vs2017/Images/SplashScreen.scale-150.png differ diff --git a/win/win32/vs2017/Images/SplashScreen.scale-200.png b/win/win32/vs2017/Images/SplashScreen.scale-200.png new file mode 100644 index 000000000..cbffd4a6a Binary files /dev/null and b/win/win32/vs2017/Images/SplashScreen.scale-200.png differ diff --git a/win/win32/vs2017/Images/SplashScreen.scale-400.png b/win/win32/vs2017/Images/SplashScreen.scale-400.png new file mode 100644 index 000000000..05424b307 Binary files /dev/null and b/win/win32/vs2017/Images/SplashScreen.scale-400.png differ diff --git a/win/win32/vs2017/Images/Square150x150Logo.scale-100.png b/win/win32/vs2017/Images/Square150x150Logo.scale-100.png new file mode 100644 index 000000000..778506203 Binary files /dev/null and b/win/win32/vs2017/Images/Square150x150Logo.scale-100.png differ diff --git a/win/win32/vs2017/Images/Square150x150Logo.scale-125.png b/win/win32/vs2017/Images/Square150x150Logo.scale-125.png new file mode 100644 index 000000000..6c625595e Binary files /dev/null and b/win/win32/vs2017/Images/Square150x150Logo.scale-125.png differ diff --git a/win/win32/vs2017/Images/Square150x150Logo.scale-150.png b/win/win32/vs2017/Images/Square150x150Logo.scale-150.png new file mode 100644 index 000000000..d0471de30 Binary files /dev/null and b/win/win32/vs2017/Images/Square150x150Logo.scale-150.png differ diff --git a/win/win32/vs2017/Images/Square150x150Logo.scale-200.png b/win/win32/vs2017/Images/Square150x150Logo.scale-200.png new file mode 100644 index 000000000..105037a99 Binary files /dev/null and b/win/win32/vs2017/Images/Square150x150Logo.scale-200.png differ diff --git a/win/win32/vs2017/Images/Square150x150Logo.scale-400.png b/win/win32/vs2017/Images/Square150x150Logo.scale-400.png new file mode 100644 index 000000000..3b5c7146b Binary files /dev/null and b/win/win32/vs2017/Images/Square150x150Logo.scale-400.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-16.png b/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-16.png new file mode 100644 index 000000000..c37bb5650 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-16.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-256.png b/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-256.png new file mode 100644 index 000000000..c5a031ec3 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-256.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-32.png b/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-32.png new file mode 100644 index 000000000..33651c0e2 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-32.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-48.png b/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-48.png new file mode 100644 index 000000000..3be7763d0 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.altform-unplated_targetsize-48.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.scale-100.png b/win/win32/vs2017/Images/Square44x44Logo.scale-100.png new file mode 100644 index 000000000..b0b2e6cfd Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.scale-100.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.scale-125.png b/win/win32/vs2017/Images/Square44x44Logo.scale-125.png new file mode 100644 index 000000000..7497e6315 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.scale-125.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.scale-150.png b/win/win32/vs2017/Images/Square44x44Logo.scale-150.png new file mode 100644 index 000000000..d8291fea8 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.scale-150.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.scale-200.png b/win/win32/vs2017/Images/Square44x44Logo.scale-200.png new file mode 100644 index 000000000..aa5dce320 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.scale-200.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.scale-400.png b/win/win32/vs2017/Images/Square44x44Logo.scale-400.png new file mode 100644 index 000000000..ec0fa86b7 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.scale-400.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.targetsize-16.png b/win/win32/vs2017/Images/Square44x44Logo.targetsize-16.png new file mode 100644 index 000000000..c2f20ed08 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.targetsize-16.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.targetsize-24.png b/win/win32/vs2017/Images/Square44x44Logo.targetsize-24.png new file mode 100644 index 000000000..87a34d0aa Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.targetsize-24.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.targetsize-24_altform-unplated.png b/win/win32/vs2017/Images/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 000000000..1e2c78548 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.targetsize-256.png b/win/win32/vs2017/Images/Square44x44Logo.targetsize-256.png new file mode 100644 index 000000000..d7793c819 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.targetsize-256.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.targetsize-32.png b/win/win32/vs2017/Images/Square44x44Logo.targetsize-32.png new file mode 100644 index 000000000..089f3635f Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.targetsize-32.png differ diff --git a/win/win32/vs2017/Images/Square44x44Logo.targetsize-48.png b/win/win32/vs2017/Images/Square44x44Logo.targetsize-48.png new file mode 100644 index 000000000..fcd6b9b25 Binary files /dev/null and b/win/win32/vs2017/Images/Square44x44Logo.targetsize-48.png differ diff --git a/win/win32/vs2017/Images/StoreLogo.backup.png b/win/win32/vs2017/Images/StoreLogo.backup.png new file mode 100644 index 000000000..a90d0b6cd Binary files /dev/null and b/win/win32/vs2017/Images/StoreLogo.backup.png differ diff --git a/win/win32/vs2017/Images/StoreLogo.scale-100.png b/win/win32/vs2017/Images/StoreLogo.scale-100.png new file mode 100644 index 000000000..7eda4fa47 Binary files /dev/null and b/win/win32/vs2017/Images/StoreLogo.scale-100.png differ diff --git a/win/win32/vs2017/Images/StoreLogo.scale-125.png b/win/win32/vs2017/Images/StoreLogo.scale-125.png new file mode 100644 index 000000000..c1a3b87e2 Binary files /dev/null and b/win/win32/vs2017/Images/StoreLogo.scale-125.png differ diff --git a/win/win32/vs2017/Images/StoreLogo.scale-150.png b/win/win32/vs2017/Images/StoreLogo.scale-150.png new file mode 100644 index 000000000..09163a158 Binary files /dev/null and b/win/win32/vs2017/Images/StoreLogo.scale-150.png differ diff --git a/win/win32/vs2017/Images/StoreLogo.scale-200.png b/win/win32/vs2017/Images/StoreLogo.scale-200.png new file mode 100644 index 000000000..854fafb9b Binary files /dev/null and b/win/win32/vs2017/Images/StoreLogo.scale-200.png differ diff --git a/win/win32/vs2017/Images/StoreLogo.scale-400.png b/win/win32/vs2017/Images/StoreLogo.scale-400.png new file mode 100644 index 000000000..9d4176160 Binary files /dev/null and b/win/win32/vs2017/Images/StoreLogo.scale-400.png differ diff --git a/win/win32/vs2017/Images/Wide310x150Logo.scale-100.png b/win/win32/vs2017/Images/Wide310x150Logo.scale-100.png new file mode 100644 index 000000000..3a29f0911 Binary files /dev/null and b/win/win32/vs2017/Images/Wide310x150Logo.scale-100.png differ diff --git a/win/win32/vs2017/Images/Wide310x150Logo.scale-125.png b/win/win32/vs2017/Images/Wide310x150Logo.scale-125.png new file mode 100644 index 000000000..5bde11842 Binary files /dev/null and b/win/win32/vs2017/Images/Wide310x150Logo.scale-125.png differ diff --git a/win/win32/vs2017/Images/Wide310x150Logo.scale-150.png b/win/win32/vs2017/Images/Wide310x150Logo.scale-150.png new file mode 100644 index 000000000..8f35b96b8 Binary files /dev/null and b/win/win32/vs2017/Images/Wide310x150Logo.scale-150.png differ diff --git a/win/win32/vs2017/Images/Wide310x150Logo.scale-200.png b/win/win32/vs2017/Images/Wide310x150Logo.scale-200.png new file mode 100644 index 000000000..a0be94e1a Binary files /dev/null and b/win/win32/vs2017/Images/Wide310x150Logo.scale-200.png differ diff --git a/win/win32/vs2017/Images/Wide310x150Logo.scale-400.png b/win/win32/vs2017/Images/Wide310x150Logo.scale-400.png new file mode 100644 index 000000000..cbffd4a6a Binary files /dev/null and b/win/win32/vs2017/Images/Wide310x150Logo.scale-400.png differ diff --git a/win/win32/vs2017/NetHack.sln b/win/win32/vs2017/NetHack.sln index 172bb7293..0d5df6b89 100644 --- a/win/win32/vs2017/NetHack.sln +++ b/win/win32/vs2017/NetHack.sln @@ -10,7 +10,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetHackW", "NetHackW.vcxpro {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} = {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} {642BC75D-ABAF-403E-8224-7C725FD4CB42} = {642BC75D-ABAF-403E-8224-7C725FD4CB42} - {6813477F-64B6-4B97-B230-438D0D233385} = {6813477F-64B6-4B97-B230-438D0D233385} {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC} = {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC} {8A3F81C7-2968-49A8-86BF-2669412AD7DE} = {8A3F81C7-2968-49A8-86BF-2669412AD7DE} EndProjectSection @@ -85,6 +84,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution NetHackProperties.props = NetHackProperties.props EndProjectSection EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "NetHackPackage", "NetHackPackage.wapproj", "{6838EC9D-F25D-4779-9CD7-2EDB61E49429}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -205,6 +206,18 @@ Global {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Release|Win32.Build.0 = Release|Win32 {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Release|x64.ActiveCfg = Release|x64 {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Release|x64.Build.0 = Release|x64 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Debug|Win32.ActiveCfg = Debug|Win32 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Debug|Win32.Build.0 = Debug|Win32 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Debug|Win32.Deploy.0 = Debug|Win32 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Debug|x64.ActiveCfg = Debug|x64 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Debug|x64.Build.0 = Debug|x64 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Debug|x64.Deploy.0 = Debug|x64 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Release|Win32.ActiveCfg = Release|Win32 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Release|Win32.Build.0 = Release|Win32 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Release|Win32.Deploy.0 = Release|Win32 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Release|x64.ActiveCfg = Release|x64 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Release|x64.Build.0 = Release|x64 + {6838EC9D-F25D-4779-9CD7-2EDB61E49429}.Release|x64.Deploy.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/win/win32/vs2017/NetHackPackage.appxmanifest b/win/win32/vs2017/NetHackPackage.appxmanifest new file mode 100644 index 000000000..da4928ca9 --- /dev/null +++ b/win/win32/vs2017/NetHackPackage.appxmanifest @@ -0,0 +1,29 @@ + + + + + NetHack 3.6 + NetHack DevTeam + Images\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/win/win32/vs2017/NetHackPackage.wapproj b/win/win32/vs2017/NetHackPackage.wapproj new file mode 100644 index 000000000..daf3091c8 --- /dev/null +++ b/win/win32/vs2017/NetHackPackage.wapproj @@ -0,0 +1,145 @@ + + + + 15.0 + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ + + + + + + $(BinDir) + + + 6838ec9d-f25d-4779-9cd7-2edb61e49429 + 10.0.17763.0 + 10.0.15063.0 + en-US + NetHackPackage_StoreKey.pfx + NetHackW.vcxproj + 19591BE8832D6EFED75019EACE7C4CA42ABC90D4 + False + True + x86 + 1 + OnApplicationRun + + + Always + + + Always + + + Always + + + Always + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NetHackW\defaults.nh + + + NetHackW\Guidebook.txt + + + NetHackW\license + + + NetHackW\nhdat$(VERSION_MAJOR)$(VERSION_MINOR)$(PATCHLEVEL) + + + NetHackW\opthelp + + + NetHackW\symbols + + + NetHackW\sysconf + + + + + + + + + + \ No newline at end of file diff --git a/win/win32/vs2017/Package.StoreAssociation.xml b/win/win32/vs2017/Package.StoreAssociation.xml new file mode 100644 index 000000000..1200895f3 --- /dev/null +++ b/win/win32/vs2017/Package.StoreAssociation.xml @@ -0,0 +1,373 @@ + + + CN=8BDC628A-FAAA-4EBA-8B5B-EB61BA93BA1F + NetHack DevTeam + AAD + http://www.w3.org/2001/04/xmlenc#sha256 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 30485NetHackDevTeam.NetHack3.6 + + NetHack 3.6 + + + + 30485NetHackDevTeam.NetHackBeta + + + \ No newline at end of file diff --git a/win/win32/vs2017/ScreenShot.PNG b/win/win32/vs2017/ScreenShot.PNG new file mode 100644 index 000000000..36d9f9876 Binary files /dev/null and b/win/win32/vs2017/ScreenShot.PNG differ diff --git a/win/win32/vs2017/travisci.sh b/win/win32/vs2017/travisci.sh index e17de0efa..812f4cdd8 100644 --- a/win/win32/vs2017/travisci.sh +++ b/win/win32/vs2017/travisci.sh @@ -32,5 +32,4 @@ cd src cp ../sys/winnt/Makefile.msc ./Makefile nmake install cd .. -powershell -Command "Compress-Archive -U -Path binary/*.* -DestinationPath NetHack-x86-beta$TRAVIS_TAG.zip" - +powershell -Command "Compress-Archive -U -Path binary/* -DestinationPath $TRAVIS_TAG.x86.zip"