Home > Net >  Winfrom installed after packaging, the path error?
Winfrom installed after packaging, the path error?

Time:09-26

Winfrom written procedures, with vs own packaging tools, packaged into exe installation package, installed on the computer, can run in D disk, Ann in C, F on disk error: the path "system volume information" access denied , but I'm not involved in this folder code, source code, no matter in which set can run normally, but not a installation package, note: the source code is not an error, installation package can be normal operation in D set but Ann runtime in the other set at the wrong ?

CodePudding user response:

Online for bosses, urgent

CodePudding user response:

Check permissions not enough ah?
If involves the configuration file to read, want to consider the problem of unable to properly read
If involves creating folders, want to consider the question of creating failure

CodePudding user response:

Should be the file is not completely control you check folder permissions

CodePudding user response:

I now find, as long as according to him to the path of the installation, the only change in which drive, is no problem, as long as changed his path, no matter in which drive, has a problem, how is that broken?

CodePudding user response:

Should be permission problems, such as other documents involved in the process of the program runs, speaking, reading and writing, or a program generated files, the need to manipulate files or folders without permission,

CodePudding user response:

How am I supposed to give it permission in the code, after all others to install, I won't be able to change their computers folder permissions?

CodePudding user response:

Write a log file to capture the abnormal information, code to create the folder usually have permissions

CodePudding user response:

You need before packaging, can custom code, give the installation path is completely written permission, do not have permission to write to the log file will make a mistake, unless you don't write the log, how to obtain the installation path, first look for information, I now WPF installation package, is to have a complete solution, many clients machines, very strange, some directories are no write permissions, unless, that is, the human, the installation package, the looks be like simple, is also the course of the coming months, I met one solve two, is a slowly, step to step 1,
///& lt; Summary> 
///to add the users folder, everyone user groups full control permissions
///& lt;/summary>
///& lt; Param name="dirPath & gt;"
The static void AddSecurityControll2Folder (string dirPath)
{
//get the folder information
DirectoryInfo dir=new DirectoryInfo (dirPath);
//get all the access to the folder
System. Security. The AccessControl. DirectorySecurity dirSecurity=dir. GetAccessControl (AccessControlSections. All);
//set file ACL inheritance
InheritanceFlags inherits=InheritanceFlags. ContainerInherit | InheritanceFlags. ObjectInherit;
//add ereryone user group access rules full control permissions
FileSystemAccessRule everyoneFileSystemAccessRule=new FileSystemAccessRule (" Everyone ", FileSystemRights FullControl, inherits, PropagationFlags. None, AccessControlType. Allow);
//add the Users access user group rules full control permissions
FileSystemAccessRule usersFileSystemAccessRule=new FileSystemAccessRule (" Users ", FileSystemRights FullControl, inherits, PropagationFlags. None, AccessControlType. Allow);
Bool isModified=false;
DirSecurity. ModifyAccessRule (AccessControlModification. Add, everyoneFileSystemAccessRule, out isModified);
DirSecurity. ModifyAccessRule (AccessControlModification. Add, usersFileSystemAccessRule, out isModified);
//set access permissions
Dir. SetAccessControl (dirSecurity);
}

CodePudding user response:

Isn't this reference you didn't pack come in? Should put all use a reference to the packaging, the references are in the program to convert into the bag

CodePudding user response:

Check whether it contains the path when packaged, or sometimes involves disk C need some folder permissions

CodePudding user response:

Should be a permissions problem,

CodePudding user response:

Try to run as an administrator.

CodePudding user response:

Not enough permissions,
Everyone access to the folder first, test,
  •  Tags:  
  • C#
  • Related