appdata

Python: Getting AppData folder in a cross-platform way

老子叫甜甜 提交于 2021-01-20 23:50:33
问题 I'd like a code snippet that gets the proper directory for app data (config files, etc) on all platforms (Win/Mac/Linux at least). For example: %APPDATA%/ on Windows. 回答1: If you don't mind using the appdirs module, it should solve your problem. (cost = you either need to install the module or include it directly in your Python application.) 回答2: Qt's QStandardPaths documentation lists paths like this. Using Python 3.8 import sys import pathlib def get_datadir() -> pathlib.Path: """ Returns a

AppData / Similar for all OS : C++?

。_饼干妹妹 提交于 2020-07-10 01:45:32
问题 I'm looking to store some "preferences" for my C++ application. Under windows I know I have to use the "AppData" folder, but I need the equivalent for Linux and OsX. Is there some library or portable way to get such information in C++ ? Here is the code I use currently: #ifdef VD_OS_WINDOWS LPWSTR wszPath = NULL; HRESULT hr = SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_CREATE, NULL, &wszPath); _bstr_t bstrPath(wszPath); std::string strPath((char*)bstrPath); CoTaskMemFree(wszPath);

How to Javascript notify() with ms-appdata on Windows 10 UWP

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-26 03:27:09
问题 Due to file-writing security issues we have tried to switch our app from using ms-appx-web: to using ms-appdata:. But it immediately fails because we rely on window.external.notify() which works fine with ms-appx-web: but seems to behave as a no-op with ms-appdata:. As a test we loaded the following html into a WebView object: <html> <head> <script> function demofunc( str ) { document.getElementById("demo").innerHTML += str; window.external.notify( str ); } </script> </head> <body onLoad=

How to clear user's app data folders with Inno Setup?

佐手、 提交于 2020-01-03 03:30:15
问题 When I uninstall my app with my Inno Setup uninstaller, the runtime files created in the user's AppData folder remain. Is it possible to remove them? 回答1: you can create a CurUninstallStepChanged routine to perform any custom action you want, like deleting files on the system during uninstall. Take a look at this example (from this question): procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep); var mres : integer; begin case CurUninstallStep of usPostUninstall: begin mres :=

Finding a Windows user's “true” application data folder?

筅森魡賤 提交于 2020-01-01 04:47:11
问题 I have a Delphi 6 application that, like most Windows applications, reads/writes data to the user's "local application data" folder. I use the code below to determine that folder. Up until now, that code worked for most of my users. I have encountered a user whose local application data is not in the expected folder: C:\Users\Bob\AppData\Roaming\ Usually the local app data folder resolves to: C:\Documents and Settings\Bob\Application Data\ What is odd about this user's particular situation is

Write to AppData directory using InnoIDE?

若如初见. 提交于 2019-12-23 07:28:34
问题 I need to write to the: C:\Users\user\AppData\Roaming\AppName folder during the setup process. I'm using the InnoIDE program for setup, and it's awesome. However, it seems to be lacking an 'AppData' special folder for easily accessing that directory. For example, you can use: DestDir: "{app}" to write the application directory. But how do you get to AppData? Is there a list of all the preset DestDir options? 回答1: Arg, got it. {userappdata} → C:\Users\user\AppData\Roaming\AppName as found here

Inno Setup Installing to AppData\Roaming on Windows Vista/7 and newer, but Application Data on Windows XP

感情迁移 提交于 2019-12-22 17:52:07
问题 I have made several scripts for inDesign. Now I want to distribute them all in a setup file. Since inDesign scripts reside in different locations on XP and Vista (or above), I'm having some problems. My compiled setup works fine under Windows XP but doesn't copy anything to Windows 7 AppData folder. When I change folder from AppData to an absolute path, it works. [Files] Source: "Akruti Converter.jsx"; DestDir: "{userappdata}\Roaming\Adobe\InDesign\Version 8.0\en_US\Scripts\Scripts Panel