Visual Installer Project - can't run app after instalation without admin right - c#

I'm trying to add Visual installer project (setup ) to my project and I have a little troubels with this. I'm using Visual Studio 2017. After installation my application don't open until i start app with admin rights, it's need only once, next running don't need admin permissions and everything works ok.

Related

How to give Administrator Privileges to my VSPackage?

I've developed a VSPackage for Visual Studio, which needs to copy some files to Visual Studio's Installation Path.
If I Run Visual Studio as Administrator (when using my installed VSPackage). It can copy files with no errors.
When I run Visual Studio normally, I get Access to the path ... is denied error.
Question
How can I give my VSPackage to admin privileges even when the Visual Studio is being run as a normal user.
Or at least how can I invoke something like this:
Your package is a .dll (loaded on a process), not an .exe (a process), and therefore it cannot have different privileges than its process (Visual Studio, that is, devenv.exe). What your package can do is to launch a different process with admin rights. See my article:
HOWTO: Launch a process with admin rights from a Visual Studio add-in on Windows Vista or higher.
That said, it is a very wrong approach to do this to copy files to the VS installation path. That should be done by the setup of your package (.msi), not by your package.
On the one hand, if it is done by the package once installed, the user could deny the elevation prompt and the files would not be copied and your installation would be incomplete. Can your package run properly without those files?
On the other hand, if the user denies the elevation prompt to install the package, it wouldn't be installed at all, which is a more clean approach.

Change Published Project Install Directory in Windows8.1

I am trying to change the default installation directory of my projects when I publish them but I seem to have no choice over where the published setup.exe actually puts the program. It seems after setup.exe running and application installed, all the processed files are under the folder of C:\Users\{username}\AppData\Local\Apps\2.0\ (Something like that, I dont remember the exact directory as it is very long). This is not what i want as I installed the program in the C:\Program Files\ but all the log files go to the C:\Users\{username}\AppData\Local\Apps\2.0\. This is really really annoying.
The application I published is C# Windows Form Application
And I have looked through online and found that somebody suggested to create an MSI package for C# Windows Application Using a Visual Studio Setup Project instead of publishing the program:
Publish Windows form application how change the installation path
It is supposed that the above website can solve this problem. Are there any other suggestions to solve this redirection problem after publishing the C# Windows Form Application? Thank you.
When you use the Publish funtion in Visual Studio, you are creating click-once publication. This type of deployment has relatively fixed rules and not everything can be configured. It allways installs into an obfuscated folder under windows user profile. It is similar to the fact, that you cannot change location where windows-store modern apps are installed under Windows 8.1.
You can create MSI setup project for your app - but in Visual Studio 2012 this type of project is missing and it was re-introduced againg in Visuals Studio 2013. There you can specify install folder. You can also use Install Shield Lite with Visual Studio 2012.
You wrote:
This is not what i want as I installed the program in the C:\Program
Files\
It is not possible to install ClickOnce application using Publish button in Visual Studio into C:\Program Files\.
If you have just problem with the location of your log files, you need to specify a different folder within your application code. Make sure that user, who is running your app, has write access to that folder - it should be in some user's profile folder or in a public folder. Avoid %ProgramFiles% as a folder for your log files - it is not a good practice.
Instead of Application.StartupPath you should use path accessible to all users including non-admin, like:
Path.Combine(Environment.GetFolderPath(SpecialFolder.CommonApplicationData),"MyCompanyName")
You can use InstallShield to create installation wizards/Setup.
Here's the free version for Visual Studio

How to transfer a ASP.NET webpage from one PC to another?

I had build a website in ASP.NET and C# using Visual studio 2013 and I published the website using IIS in windows.
Now I want to make some other PC as a server instead of current one.
For that do I need to install visual studio in the newer one or
Is it enough to simply copy the website folder to the new PC and publish that folder via IIS in new PC.
NOTE: I dont want want to compile the Website since I tested it already.
no need to install Visual Studio again and Publish the website again using Visual Studio
Copy / pste will work fine
Just make sure you copy everything and that IIS is set up correctly
In Visual Studio, you right-click the project in Solution Explorer. Then, you should click the Publish on the right click menu. That will give you a publishable project files. You need to set IIS on your new computer, then you should put those publisable files into IIS. That's it.

How to log a project that is being deployed from Visual Studio?

I have a C# project written using Visual Studio Express 2013 for Windows Desktop. When I run the project in debug mode via Visual Studio (on Windows 8 Pro) it executes just fine, and so does copying the files out of the bin directory.
I need to deploy to a Windows 7 Embedded System with the correct version of .NET Framework. I tried:
copying the files over with the .dll and everythig from the bin folder and when starting I get no error, but doesn't start at all. I get no information at all.
tried the one click installer (choosing the option to install from dvd) and it seemed to install fine, but when I start it, I get same issue. Not starting, and no messages.
I also tried the Advanced Installer (free version) and when importing the visual studio project files it fails with the message "Failed to start Visual Studio. Error: Invalid Class String"
[UPDATE] Advanced Installer cannot import VS Express solutions because the API from VS that provides assistance on import is not available for VS Express edition. Only solutions created with paid editions of VS can be imported in Advanced Installer.
So how can I log or see what is happening to debug this?

Visual Studio Project Not Running properly

When I open any application or start a new application it will build the application but it will not run the application. I have restarted my computer and checked task manager for any processes pertaining to my application. If I run visual studio as administrator the application will run but it will not build automatically even though in the visual studio setting it is set to build and run. However if I copy my application to another computer it builds and runs perfectly fine. I usually use Visual Studio 2010 Professional but I also have Visual Studio 2012. The problem is constant between the two applications. Any suggestions?
Try removing the obj files withing your project directory.

Categories

Resources