please, could someone point me into the right direction? Here's the problem, I created my own installer for my synth plugins: VST, VST3 and Component.
On Windows I just set it to ask for Administrator rights and it them can save the plugins anywhere. On OSX the story is different, I couldn't find an EASY way to put files into folders when they don't have the right permissions. Not only that, but I can't open the folder for reading after it is saved, so that's another problem.
Resuming:
A) how to elevate file privileges on OSX so that I can save plugin files (.vst, .vst3, .components) into any folder
B) how can I read data files (such as skin files) from a folder that requires elevated rights?
C) I'm using JUCE, you can check my work at www.Wusik.com
Thank you for any advice.
Cheers, WilliamK
I believe Authorization Services is what you would need.
Or you might consider creating an installer package using Packages.
Related
Is there a way to check and find all in once all clouded folder that are on a computer without enumerate all possibilities ?
What I need is : I take a path and it tells me if it's a clouded folder.
Example : I use Google Drive, OneDrive, DropBox, and other. I would like to know if it's one of them without having to enumerate all possibilities of each services like :
Onedrive can be check on registry and have "Drive" on his path;
Google Drive have a .ini file on root folder and have "Drive" on his path;
DropBox have a file on root folder (I think) ;
Can't find the magic solution that check all services that exists.
Is there a secret tag or info hidden on folder saying "I'm related to a cloud service" ?
Can't found nothing about it :(
I've checked GetDriveTypeW but OneDrive and GoogleDrive are detect as fixed drive (and it's normal) and FILE_REMOTE_PROTOCOL_INFO but no sign of answer there either..
Please help !
Thanks.
I think you're out of luck this time. I don't believe there is anything fundamental in the Windows operating system or filesystem that tells you if an application installed on the system is mirroring or otherwise syncing files and folders. There is no magic bullet, to the best of my knowledge.
You'll have to tackle these on an application-by-application basis using awareness of each type of service and which folders it is syncing as you are currently doing.
Here is the issue that I am having,
I have a C++ application that runs by writing data to .txt files and I want to create an MSI Package for the application.
When I build and run my app all is fine but when I run my MSI Setup File the created application does get granted the correct privileges to function.
I can't find a way to allow the app to write to the .txt files needed even if I include them in the package and set them as system files.
If I "Run as administrator" all is well but that isn't really plausible as I need it to function while "Running as User".
Is there anyway to prompt the user while installing to agree to an install with admin rights, so it doesn't have to be done manually before a prompt each launch.
Anything that can get my code running again would be brilliant, thanks.
Longer Writeup: System.UnauthorizedAccessException while running .exe under program files (several other options in addition to the ones listed below).
Per-User Folder: I would think you should install the files in question to a per-user folder (writeable for user - for example My Documents), or as templates to a per-machine folder (not writeable for normal users - for example %ProgramFiles%) and then have your application copy the templates from the per-machine location to the current user's My Documents folder - for example. Then you write to the files there - where a regular user will have write access. I suppose you could also write to a network share which is set up for users to have access.
Elevation: It is possible, to require the application to run elevated (link might be outdated - for .NET it is slightly different), but this is a horrible approach for something as simple as writing to text files. I would never require such elevation. Elevated rights are pervasive, and you don't want your application to run with the keys to the city - you become a hacker target and bugs in your tool become armed and dangerous.
ACL Modification: It is also possible to install the text files to a per-machine location and apply ACL permissioning to them so that they are writeable for regular users even if they don't have elevated rights. There is some information on how to do this here (bullet point 2). This approach is frowned upon in this day and age, but it will work. Be on the alert that your ACL permissioning shouldn't be too tight, in case you write to a new file, delete the old one and rename the new file to the old name during your write operation - you need file create in addition to file write obviously - there is very fine-grained control in NTFS. GenericWrite should do the trick I think.
Some Links (loosely connected, added for easy retrieval):
Create folder and file on Current user profile, from Admin Profile
Why is it a good idea to limit deployment of files to the user-profile or HKCU when using MSI?
Create a .config folder in the user folder
There is no connection at all between the install of an application and the running of an application regarding privileges. In other words there is nothing you can do in an MSI install that grants elevated privileges to the app being installed. It would be a massive security breach if a limited user could create an MSI setup that then installed an app that ran elevated.
So this question is actually nothing to do with Windows Installer - it's about whether you require users to be limited users or elevated users. If it's acceptable that users must be privileged, then you give the app an elevation manifest. If limited users will use it, then all writes or modifications to files or registry entries must be to locations available to limited users. It also means that the app won't be able to perform privileged operations, such as starting or stopping services.
I want to ask you a couple of questions i looked in internet and didn't found an answer though...
I have an application for windows 10 PCx64 (artifacts of a built project C++/x64)
Is it possible to create odrinary Windows Store deployment file from folder?
How to do that? As i see MS is pushing new 'universal applciations' concept. But i don't want to rewrite apps entirely to .net/c#/Universal Apps. I just want to change build process so it will produce windows store deployment file, not MSI
Thanks!
You will soon be able to create a Windows Store package for a Win32 app and deploy it through the Windows Store. You'll even get access to UWP APIs and services :)
Subscribe to the "Windows Developer Preview Programs" to get some fresh news about "Project Centennial".
https://devpreviewsignup.windows.com/
I am trying to release a C++ .Net application and am getting very frustrated with Windows UAC. I have not much experience with this as have always been writing for XP.
The program needs to update some properties that are stored in two XML files and every time it tries it gets access denied if it is not running with an Administrator account.
I have followed the recommendations from Microsoft and am writing all the files that need to be modified to the CSIDL_COMMON_APPDATA folder. The installer has an action that creates the [Organization}[Program] structure within the later and adds the security group Every One with full control privilege because by default, that directory is read only.
I have verified that the cretated directory [Organization}[Program] does actually contains the group and the privilege assigned after installing.
Also, the application has a manifest with a requestedExecutionLevel, which I have tried asinvoker and Highestavailable.
The application is still not being capable of writing to the directory unless the user is not logged as Administrator...
The machines are in a domain controled by a server 2003 but the clients are a mix of XP, vista and 7.
Please, could someone with more experience in this than I enlight me?
Should I use some other folder? The problem is that Different users might log into the computer and those settings are common, therefore the obvious User folder is not an option.
I cannot either add the user to the security of the folders with the installer because I don't know which user from the domain will use the program and I cannot do it from the program when starting because if the user does not have adminstrator rights the program will just be blocked.
Please, any advise or indication about what am I missing here?
This may discuss your problem. See especially
Your application's installer needs to set ACLs on your subdirectory of CSIDL_COMMON_APPDATA to allow users to access that directory as required by your application
My app started new process by ShellExecuteEx with "runas" verb in order to get administrator privilegies. New process creates some files in the user folder, but files can't be readed by built-in users. Only administrators can access those files. Same problem on XP and Vista.
I tried to read SetNamedSecurityInfo() docs but it's too complex for newbee. Can somebody tell how to just enable file read access for built-in users ?
Thanks.
When a user creates a file, the file owner is set to that user by default. Therefore, when you run commands as the administrator that create files, those files are owned by the administrator, not you. You either need to find a smaller command to runas the administrator that doesn't create tons of files, or you need to add another runas command that changes the ownership of those files back to your user.
I must confess I don't have experience in Windows programming, as I come from the Linux world, but I'm sure someone else can help you find the suitable commands if you post some code to help us understand what you're trying to do.