Hello!

I am writing a project on C # .Net 3.5 winforms, in this project I use GeckoFx and in the project there is a folder "xulrunner" which lies next to the program.

The question is: how to hide this folder from users? Is it possible to pack it like that in exe's and launch it from there?

ps about exe'shnik it I certainly got excited, but you never know))

  • four
    Why hide it from users? Your program is installed in Program Files, the user sees only a shortcut. in 2017, no one launches programs from under the command line. - VladD
  • one
    @VladD I run =) and write support for the command line keys for the same reactionaries =). But in general, you are probably right, the user, on average, is sure that removing the shortcut from the desktop, he deletes the program = (so you can not worry too much about hiding the service folders, in extreme cases put in AppData, there will be the last search - rdorn
  • @rdorn: You run, yes. But you are a programmer. And users have long been anyway. On some systems, you as a user simply will not get access to the program files (for example, on phones). - VladD
  • About AppData also thought, I think that this is the most suitable option. In general, my concerns are far from the fact that the user will look at something or delete it from the folder, this is solved. I just write a program that uses copy protection, etc. And I thought, “If a non-respectable user (scoundrel) sees this folder, it will immediately become clear to him that it’s .Net and all my efforts, though not much, from .Net Reactor to the cat's tail” - FieldySlap
  • one
    @rdorn, the settings usually do not weigh 2 gigas;) But the idea of ​​putting constant files on profiles (instead of the same program files) is bad. - Qwertiy ♦

2 answers 2

In the simplest case, you can set the attribute Hidden to the folder, by default the display of hidden files and folders is disabled.

For service files of programs there is an AppData folder. The folder is hidden by default, but the user has full rights in it, so no additional manipulations to configure user rights will be required. These folders, generally speaking, are at least two, personal to the user and common to all users, which allows you to make various installation options personal or common, although in the case of installing the program for all users, I would recommend the classic placement option in ProgrammFiles using not less classic installers.

There are many different opinions on the use of this folder, two of them have already been discussed in the comments, I see no point in repeating. If the program does not require special rights in the system and the corresponding installer, then in the context of .NET and VisualStudio, you can use the ClickOnce technology. The installer will place your published program in the user's AppData and, with the appropriate settings, will even automatically check for updates, if you are going to release them, of course, without requiring the user to have system administrator rights to install and update the program.

As for hiding service folders, I don’t see any reason to worry about this, because The average level of computer literacy of the user is rather low, then no one will climb up the service folders just until the “good man” uploads a detailed video “how to hack program X” (change the title to your taste, and yes, it’s the video, the article already This is not something you need to read, and write in general, too), and this will happen only when (and if) your program becomes popular enough for the average user.

To see this is very sad, but the likelihood of a change for the better with time only decreases, so that security through obscurity is an ideologically incorrect decision, but often it is necessary and sufficient.

    I will use the option with AppData, this is the most suitable option.