Shareware vb.net application packed using innosetup, installed in different directories creates 2 different set of application - vb.net

I have created an shareware application using vb.net visual studio 2008 for windows desktop, and packaged it using innosetup 5.3.8. The problem is when i have installed the application in C:\Program Files\Application and it runs successfully(use trial period of the application), Im also able to install the application once again freshly with the same setup by installing in different directory.eg C:\Program Files\Application new . The application in C:\Program Files\Application new does not have any settings of the already installed one.
Where do i went wrong . Do i need to take care of this in my application(vb.net) or innosetup. How to take care of the already installed path in innosetup or carry the settings of already installed application to newly installed path by upgrading the older one.
I dont want to write any thing in registry because the application does not want any administrative permission requirements.If i install the application in same path it gets updated with the older settings being taken over to this new one and it works fine.

Windows applications normally save their settings in the registry under HKEY_CURRENT_USER\Software\YourCompany\YourApp or as files under %APPDATA%\YourCompany\YourApp. Both locations can be written to without admin privileges, and both locations are user-specific. That is, if two users use the same computer, both can use your application with their own settings without affecting the other user.
You should never save any settings under c:\Program Files. Writing to the Program Files folder requires admin privileges. If your application does not have a manifest then writing to Program Files may appear to work. What is really happening is that the files you're writing to the Program Files folder are rerouted to the VirtualStore. Unless the system administrator has disabled the VirtualStore. Then your application will fail.
If you want your application to be robust, it should only save settings to HKEY_CURRENT_USER\Software\YourCompany\YourApp and/or %APPDATA%\YourCompany\YourApp. Your application should use its default setting if no previously saved settings can be found in these locations.

Related

ClickOnce default installation path

I inherited a Windows Forms Application (.NET Framework 4) that uses ClickOnce for installation. Everything is working perfectly except I cannot seem to set the default installation path. Currently it gets installed to:
%appdata%\Local\Apps\2.0\xxx
where xxx is some randomly created path. This is causing problems with out virus scanner which is deactivating the program randomly. We cannot exclude the 2.0 directory from scanning as other programs that are not under our control also install to this folder.
I found this online:
https://social.msdn.microsoft.com/Forums/en-US/c6e3d328-1deb-49c9-99cf-98fe3830702a/where-does-clickonce-put-files?forum=winformssetup
where it states that I can set:
System.Deployment.Application.ApplicationDeployment.CurrentDeployment.DataDirectory
to set the data directory -> which might set the program directory as well?
I just cannot seem to find where I can set this path - Any ideas? I have never used ClickOnce before (and am new to Visual Studio) so please give me clear instructions.
Thanking you in advance
see comment:
The data directory is where data files, e.g. MDF and MDB files, get stored. You can't set the install location of a ClickOnce app. They get installed to the ClickOnce cache, which is what makes them ClickOnce apps. – jmcilhinney

clickonce deployment with prerequisites

We have an application that we deploy to a website. User goes to the website and downloads the application to their machine.
There are a few prerequisites such as .net and sql server 2012 express that we just click in the "prereqs" to install. But we also have another executable file syncronization which is an exe that the user needs to install before loading the application. How can we also include that so before the app runs it loads this as well. because i don't see an option to include it, it just has the standard default microsoft ones.
So basically you want to run a .exe file along with your main app???
Or it is like the .exe file should load before when you start the main app????

Wix Toolset vs. InstallShield - VirtualStore Access

I developed an application with VS2010 and a setup deployment with IS Limited Edition. The application provides some data in a XML file, which is installed in the same folder. If the app was making changes in the XML file, this was saved in virtualStore.
I use now VS2015 and Wix Toolset. The application can be compiled and I was able to code a WXS File. The new built MSI install the app and all seems ok. But now the app cannot access the XML file. The access is denied.
I tried to compare both MSI with Orca, but don't see something noticeable. I'm not sure, if this is a problem of setup or of the application itself.
edit
If I copy the "old" EXE file in the new installation, the application can access the XML file.
Thank you for help and hints
If a program appears to be from before Windows Vista, is running as a limited user, and attempts to write to certain machine-only locations, Windows may redirect its access to the virtual store as part of a backwards compatibility shim. If the program does not appear to be from before Windows Vista, no redirection is performed.
I believe Windows detects whether a program appears to be from before Windows Vista by reading its manifest for supported platforms - the supportedOS elements in the application manifest. My guess is the change in your toolchain from VS 2010 to VS 2015 has resulted in this element being added to your application's manifest (Windows XP is past its supported lifetime and thus Visual Studio 2015 can implicitly assume you are supporting at least Vista).
You may be able to override the manifest, but really you should fix your program to not attempt to write to per-machine locations. Ideally you should use a location such as the LocalAppData folder, although for backwards compatibility there may be benefits to at least reading the old file from the Virtual Store.

WPF Desktop Application with MDF used locally for all local users

I am using Visual Studio 2013. I have all components installed on my machine needed to run this application I am questioning. I have not completed the application to deploy for testing but some questions arose before completion that I need addressed now; to prevent overhauling later.
Here's how it should work when deployed to clients.
Client installs application which runs on desktop not windows store in WPF.
The application is per user and runs for all users on the local machine.
Each user needs to read and write data to a database file but it needs to be the same MDF being used. Therefore each process of the application, no matter the user session, on the same machine, all interact with the same database / same data.
Question: When adding the database to the project where will it be installed by default? In the applications program folder along with program? If so what restrictions exist to read/write to the database and are there any? I have added no extra security on my side. The info isn't private or critical.
Question: Would end users need to install any sort of SQL in order for the application to do this? If so I can package it with the install but this seems like alot of overhead during install.
If the MDF is installed per user how do I change this to install it once for all users?
Before saying so, yes this needs to be a database and not a file. Reasons I need not describe. I have considered alternative but this is by far the best solution so please no alternatives.
When you add mdf file to your project and set properly the value of Copy to Output Directory, it will be copied to the bin directory of your project whenever you build the project. When you create setup project for your app project, it will be by default copied to the folder where your app is installed. You can either specify different location in your setup project or copy the file to the desired location during the first run of your app.
There are several suitable folders in Windows, one possible choice is %PROGRAMDATA% C:\ProgramData folder, but it is by default read only for non-admin users. If you do not worry about security, go for %PUBLIC% C:\Users\Public. It is completely accessible for all users within interactive group.
I recommend to package LocalDB with your project. It can be installed silently with one line of code, though only with admin privileges. For non-admin click-once install you would have to use SQL CE, which is quite different and uses sdf files.
I think you should do it this way: include a seed database MDF file in the application and copy it to a %PUBLIC%\YourApp folder when the application first launches. Optionally include LocalDB install in your setup project.

Microsoft Visual Studio 2005 (Vb.net)

I'm doing my project in Vb.net. my project name is "Bellows". My front end is Vb.net. Back end is Ms Access.
i Create My project in Windows Application
i complete my project. i copy the .exe file from "E:\BellowNet(new)\Bellows\obj\Debug" and put the shortcut into my desktop. now it's running.
similarly i copied my Bellows.exe from another system desktop but it not running.
How i want to run my Bellows.exe from another systems (maximum 10 systems).
Note : In my system only having Microsoft Visual Studio 2005. Remaining system doesn't have.
I put bellows.exe from another system. in that system doesn't having E Drive. it showing this error
The application Filed to initialize properly(0xc0000135). Click Ok to terminate the application
Similarly I put bellows.exe from another system. in that system having E Drive.
if i click that Bellows.exe the login form is open.. and main form is open. in that main form wen i click button it show the error.
Unhandled exception has occurred in your application. If u click continue the application will ignore this error and attempt to continue. If u click Quit, the application will close immediately. Could not load file or assembly ‘ADODB, Version=7.0.3300.0, Culture=neutral, PublickeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified
Good practice to run your project on another systems is to create its setup file and then install it on to another systems on which you want to run your project and of course you need to install .NetFramework as well with the same version which you used to developed your project. How to create setup and how to add Serial Key for those steps refer my blog
It sounds like either the .Net Framework is not installed on your target system or that there's an app.config file (Bellows.app.config) that you need to copy over as well.
Another thing that concerns me is what your expectations are for the access database. Do you want all the workstations to share a common database? If so, I highly recommend you convert your app to use Sql Server Express Edition (free). Access is an in-process database engine, and like all such engines it doesn't behave well when shared. If you don't expect them to share the database, you probably want to make sure you copy that *.mdb file over to your target machines as well.
Finally, let me re-iterate the advice in other answers about using a Release build and/or deployment project.
What errors do you see?
It could be:
The other system does not have .Net
framework 2.0 installed
You copied only the exe from the dev machine without other required files from the Debug directory (e.g., app.config, supporting DLLs).
If you are going to copy and paste the exe file then the all Prerequiest should be installed on that machine like framework.So make a setup file which is easy and add all Prerequiest on the setup after that do setup on new machine..
Thanks
I can only guess, but try this suggestions.
The application Filed to initialize
properly(0xc0000135). Click Ok to
terminate the application
.NET framework is not installed on this machine. Install the runtime.
Could not load file or
assembly ‘ADODB, Version=7.0.3300.0,
Culture=neutral,
PublickeyToken=b03f5f7f11d50a3a’ or
one of its dependencies. The system
cannot find the file specified
ADO.NET drivers are missing. You need to install Microsoft Data Access Components
You can avoid this problems if you make an install procedure and do the proper install on every machine.
The appropriate .NET framework must be installed in each machine as well as the appropriate MDAC. You can add them as part of the installation package.
http://msdn.microsoft.com/en-us/library/ms994427.aspx
And if you want to make it even more easier for your clients to get hold of it; use ClickOnce to distribute it from a central server.
http://www.15seconds.com/issue/041229.htm