PDA

View Full Version : Unable to start application when files are installed to default installation folder.



duddelar
05-18-2017, 04:58 AM
Hi All,

I am new to install shield and created an application .I have files installed to default install location that is C:\Program Files (x86)\<companyname>\<applicationname>\
But when I launch application on the desktop or from startmenu application is closing due to unable to access one of the xml file in the installation folder.
The same is working when I change the install location path and install to different location.
What can i do for application to work from the default install location.

Please help me in this regard.Appreciate your help.

Thanks & Rgds,
Ravi.

chad.petersen
05-18-2017, 10:29 AM
One folder versus another should not matter. Any folder name should be fine for the installers own purposes as long as you have read/write access.

I suspect something else - like perhaps your program can't access something if there are spaces in the path? Something like that. There is nothing inside of an installer, generally, that you have to set to make it work in a default location.

The question to ask, in my mind anyway, is why can't your application access the particular XML file when you choose your default location?

You'd said "is closing due to unable to access one of the xml file in the installation folder." - this sounds like the problem to debug - could be space in the path is affecting your application - could be something else - but I highly doubt the installer itself is the issue. I think it is simply "exposing" the issue.

Chad

rguggisberg
05-18-2017, 11:06 AM
Sounds like a permissions issue. Does user have proper permission to C:\Program Files (x86)\<companyname>\<applicationname>\ ?
You did not say what you used for a "different location", but I bet it was something other than C:\Program Files (x86)\...
I would bet that a location of C:\Program Files (x86)\<SomethingElse>\<SomethingElse>\ would not work either.

Stefan_M
05-18-2017, 11:45 PM
Solutions
1: Start your application with admin rights. (not a good idea)
2. Change your program. Files like XML the application have to change should be stored in something like c:\programdata\<companyname>\<applicationname>

duddelar
05-19-2017, 02:47 AM
One folder versus another should not matter. Any folder name should be fine for the installers own purposes as long as you have read/write access.

I suspect something else - like perhaps your program can't access something if there are spaces in the path? Something like that. There is nothing inside of an installer, generally, that you have to set to make it work in a default location.

The question to ask, in my mind anyway, is why can't your application access the particular XML file when you choose your default location?

You'd said "is closing due to unable to access one of the xml file in the installation folder." - this sounds like the problem to debug - could be space in the path is affecting your application - could be something else - but I highly doubt the installer itself is the issue. I think it is simply "exposing" the issue.

Chad

Hi peterson,

Thanks you for your reply.I have created same folder structure in D: as D:\Program Files\Compname\Productname\ and installed and when i launch from desktop it works properly.
Only in the case of c:\Program Files\Compname\Productname\ it gives an exception System.UnauthorisedAcessException: Access to the path 'c:\Program Files\compname\productname\resources\xyz.xml' is denied.
Iam using installshield 2016 premier trial version.
Thank You

duddelar
05-22-2017, 12:24 AM
One folder versus another should not matter. Any folder name should be fine for the installers own purposes as long as you have read/write access.

I suspect something else - like perhaps your program can't access something if there are spaces in the path? Something like that. There is nothing inside of an installer, generally, that you have to set to make it work in a default location.

The question to ask, in my mind anyway, is why can't your application access the particular XML file when you choose your default location?

You'd said "is closing due to unable to access one of the xml file in the installation folder." - this sounds like the problem to debug - could be space in the path is affecting your application - could be something else - but I highly doubt the installer itself is the issue. I think it is simply "exposing" the issue.

Chad

Hi Peterson.
Same folder I have created in D: drive and it works fine.I guss it is a permission issue.But the user has all admin permissions.
Iam using trail version of installshield 2016 premier.So is that a problem.

chad.petersen
05-22-2017, 09:52 AM
You can't use the Trial version to distribute the installer to the public - but it should be fine if you are just testing things to see how it works.

I would still recommend having someone who can debug your application look when it is installed to C:\Program......whatever path you find is not working - and debug the issue - Installers themselves don't control the application once it is installed.

Chad

duddelar
05-23-2017, 04:23 AM
Sounds like a permissions issue. Does user have proper permission to C:\Program Files (x86)\<companyname>\<applicationname>\ ?
You did not say what you used for a "different location", but I bet it was something other than C:\Program Files (x86)\...
I would bet that a location of C:\Program Files (x86)\<SomethingElse>\<SomethingElse>\ would not work either.

Hi guggisberg,
Thanks for your reply.
Yes i was using d: folder for installation and it works fine.
But I guess if the installer is built for all users it should work where ever it is.
Pls correct me and tell me if anything needs to be done.

Thanks & Rgds,
Ravi.

duddelar
05-23-2017, 04:29 AM
You can't use the Trial version to distribute the installer to the public - but it should be fine if you are just testing things to see how it works.

I would still recommend having someone who can debug your application look when it is installed to C:\Program......whatever path you find is not working - and debug the issue - Installers themselves don't control the application once it is installed.

Chad

Hi Chad,
Thank you. I vll convey the same with developers.Iam using evaluation for testing.
Will soon have licensed one for our work.

duddelar
05-23-2017, 04:47 AM
Solutions
1: Start your application with admin rights. (not a good idea)
2. Change your program. Files like XML the application have to change should be stored in something like c:\programdata\<companyname>\<applicationname>

Hi Stefan

Thanks for the reply.
You mean installation folder for placing xml files shud be different?

Thanks & Rgds,
Ravi.

rguggisberg
05-23-2017, 10:46 AM
Hi guggisberg,
Thanks for your reply.
Yes i was using d: folder for installation and it works fine.
But I guess if the installer is built for all users it should work where ever it is.
Pls correct me and tell me if anything needs to be done.

Thanks & Rgds,
Ravi.

Yes, it CAN work as you want, but you will have to do one of 3 things:
1. Do as Stephan_M suggested and "Change your program. Files like XML the application have to change should be stored in something like c:\programdata\<companyname>\<applicationname>"
2. Go to the Releases view , select the Setup.exe tab and set the 'Required Execution Level' to "Administrator"
3. Have users specify 'Run as Administrator" when running your installer

Stefan_M
05-31-2017, 04:41 AM
Hi Stefan

Thanks for the reply.
You mean installation folder for placing xml files shud be different?

Thanks & Rgds,
Ravi.

Short information: The directories 'C:\Program Files' and 'C:\Program Files (x86)' are protected from the operating system. Only Setups with elevated rights are allowed to copy or change files in this two directories.

If your XML file has to be changed from your program then it schould be placed in c:\programdata\<companyname>\<applicationname>" or if it depends on the the user context you should use C:\Users\%Username%\<companyname>\<applicationname>