Pull app.config file from the setups current directory
-
5aclockshadow
- Posts: 63
- Joined: Thu Feb 05, 2009 9:27 am
- Location: NJ, USA
Pull app.config file from the setups current directory
I just upgraded to v2012...
Is there a way to pull app.config file from the setups current directory? I would like to build one setup where I will install all the app's support files except the app.config would be pulled from whatever directory the setup is ran from.
I want to deploy this setup to many different customers. Each customer will have different database connection string info (server name, db name, etc.). The user that will install this app won't have this info so asking for this info via dialogs won't work. I would like to pre-configure each customer's app.config file w/ their db info and when the setup is ran have the setup install/copy that file.
Is this possible? If so, what's the best way to accomplish this?
So directory structure could look something like this:
http://www.CustomerWebAppURL.com/download/Setup.exe
The file structure could look like:
C:\inetpub\wwwroot\CustomerWebApp\download\Setup.exe
C:\inetpub\wwwroot\CustomerWebApp\download\app.config
The app.config file would be different for each customer.
Thanks for any help!
Is there a way to pull app.config file from the setups current directory? I would like to build one setup where I will install all the app's support files except the app.config would be pulled from whatever directory the setup is ran from.
I want to deploy this setup to many different customers. Each customer will have different database connection string info (server name, db name, etc.). The user that will install this app won't have this info so asking for this info via dialogs won't work. I would like to pre-configure each customer's app.config file w/ their db info and when the setup is ran have the setup install/copy that file.
Is this possible? If so, what's the best way to accomplish this?
So directory structure could look something like this:
http://www.CustomerWebAppURL.com/download/Setup.exe
The file structure could look like:
C:\inetpub\wwwroot\CustomerWebApp\download\Setup.exe
C:\inetpub\wwwroot\CustomerWebApp\download\app.config
The app.config file would be different for each customer.
Thanks for any help!
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Pull app.config file from the setups current directory
Dear User,
If I have not missed anything, want you to give a personalized version of your "app.config " file in your setup based on a specific customer settings?
If TRUE, I might suggest to verify the possibility of using "IA AUtomation" feature.
Using it you may build a setup based on setting that you can define at compile time, in your case you could add a specif file based on your customer need.
In this case each setup package is different for each one of your customer (the same as InstallAware does with license setup file).
Or
During a setup execution you should provied a way to enter these setting and via script could update your file accordingly.
Hope this helps you.
If I have not missed anything, want you to give a personalized version of your "app.config " file in your setup based on a specific customer settings?
If TRUE, I might suggest to verify the possibility of using "IA AUtomation" feature.
Using it you may build a setup based on setting that you can define at compile time, in your case you could add a specif file based on your customer need.
In this case each setup package is different for each one of your customer (the same as InstallAware does with license setup file).
Or
During a setup execution you should provied a way to enter these setting and via script could update your file accordingly.
Hope this helps you.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
5aclockshadow
- Posts: 63
- Joined: Thu Feb 05, 2009 9:27 am
- Location: NJ, USA
Re: Pull app.config file from the setups current directory
Thanks for the response.
We don't want to compile anything for each customer. Otherwise we would just enter each customer's connection string info into their custom app.config file and compile a custom Setup.exe for each customer. So I don't think "IA AUtomation" feature would work (but just in case, is this free and included w/ v2012? How do I access it? Where can I find more info on this approach?).
I'm not 100% sure what is meant by:
"During a setup execution you should provied a way to enter these setting and via script could update your file accordingly."
What do you mean by "via script"? The end user that would be performing the installation won't have the connection string information, otherwise I would just add textboxes to the dialog and ask them to type in the info and then use EditFile command to update the app.config.
I will have the connection string info (or the tech will, or the system admin will) ... so I'm looking for a way to place that info somewhere so the setup can grab that info. If doing this "via script" will do this, then please provide details on how to accomplish this.
I thought maybe this could be accomplished using Define Web Media Block, however how can the setup know where to grab the file? The URL will be different for each customer:
http://ABCcompanyServer/APPCONFIG.7zip
http://XYZcompanyServer/APPCONFIG.7zip
Thanks again for any help!
We don't want to compile anything for each customer. Otherwise we would just enter each customer's connection string info into their custom app.config file and compile a custom Setup.exe for each customer. So I don't think "IA AUtomation" feature would work (but just in case, is this free and included w/ v2012? How do I access it? Where can I find more info on this approach?).
I'm not 100% sure what is meant by:
"During a setup execution you should provied a way to enter these setting and via script could update your file accordingly."
What do you mean by "via script"? The end user that would be performing the installation won't have the connection string information, otherwise I would just add textboxes to the dialog and ask them to type in the info and then use EditFile command to update the app.config.
I will have the connection string info (or the tech will, or the system admin will) ... so I'm looking for a way to place that info somewhere so the setup can grab that info. If doing this "via script" will do this, then please provide details on how to accomplish this.
I thought maybe this could be accomplished using Define Web Media Block, however how can the setup know where to grab the file? The URL will be different for each customer:
http://ABCcompanyServer/APPCONFIG.7zip
http://XYZcompanyServer/APPCONFIG.7zip
Thanks again for any help!
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Pull app.config file from the setups current directory
Supposing that at build time, when you create you setup this is not available, the use of WEB BLOCK becomes unworkable.
Supposing that even when the user runs the setup exe, it is not posibble to fill somewhere these data, in order to create the file.
The problem it is to know when these infos becomes available.
Supposing that even when the user runs the setup exe, it is not posibble to fill somewhere these data, in order to create the file.
The problem it is to know when these infos becomes available.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
5aclockshadow
- Posts: 63
- Joined: Thu Feb 05, 2009 9:27 am
- Location: NJ, USA
Re: Pull app.config file from the setups current directory
Hmm...I'm not sure I follow.
Let me explain what I'm looking for in a different way.
I would like to compile one single Setup.exe today that I can use for many customers over the next several years. Once this setup is compiled, I should not have to touch InstallAware again. We will place this Setup.exe on our customer's web server. Our customer's end users will click on a link to this setup. When the end user clicks on run it should install this app and it should be fully configured to point to that customer's database.
So the following info will be different for each customer:
Provider (MS SQL vs. Oracle)
Database username
Database password
Database name
Server name or ip address
Can this be accomplished? If so, what is the best way?
I was hoping that we can simply open the app.config file in notepad, update it w/ the customer's information, and save it to the same directory that the Setup.exe is located. I was hoping that the setup could be smart enough to know and grab this app.config file from the same directory that the Setup.exe was ran from, and use that app.config to install it on the target PC.
If this is not possible, what are my options? Can the setup pull information (text) from some other relative path? Perhaps in some other format (.txt, .ini, etc.)?
What if the setup is compiled as an uncompressed directory? Can I just go into the uncompressed files and replace the app.config each time?
This setup is tiny ... only 12 MB.
Please let me know what my options are.
Thanks again!
Let me explain what I'm looking for in a different way.
I would like to compile one single Setup.exe today that I can use for many customers over the next several years. Once this setup is compiled, I should not have to touch InstallAware again. We will place this Setup.exe on our customer's web server. Our customer's end users will click on a link to this setup. When the end user clicks on run it should install this app and it should be fully configured to point to that customer's database.
So the following info will be different for each customer:
Provider (MS SQL vs. Oracle)
Database username
Database password
Database name
Server name or ip address
Can this be accomplished? If so, what is the best way?
I was hoping that we can simply open the app.config file in notepad, update it w/ the customer's information, and save it to the same directory that the Setup.exe is located. I was hoping that the setup could be smart enough to know and grab this app.config file from the same directory that the Setup.exe was ran from, and use that app.config to install it on the target PC.
If this is not possible, what are my options? Can the setup pull information (text) from some other relative path? Perhaps in some other format (.txt, .ini, etc.)?
What if the setup is compiled as an uncompressed directory? Can I just go into the uncompressed files and replace the app.config each time?
This setup is tiny ... only 12 MB.
Please let me know what my options are.
Thanks again!
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Pull app.config file from the setups current directory
Dear User,
I understand what you like to do but I have some doubts about how to make it possible.
To summarize:
You would like to have a single setup build for all your customers.
This setup includes everything to be executed in order to run your application.
Your App.config it is installed by the setup, but it doesn contain any info about specific user setting.
Every single install requires that your App.Config file to be updated accordingly to each specific user setting, about: User name, password and so on.
Assumed this For what I understand, this should happen after the user have installed the software. So you have to provide a way to update the already installed App.Config file with the required user data.
Is this correct I would like to know:
when are you informed about those data? in other words, the user will communicate those infos to you after your software installation?
But you say also:
But in this case you are informed about this required info before that you ship the software
I'm sorry but I'm trying to understand your intentions.
Let me know.
I understand what you like to do but I have some doubts about how to make it possible.
To summarize:
You would like to have a single setup build for all your customers.
This setup includes everything to be executed in order to run your application.
Your App.config it is installed by the setup, but it doesn contain any info about specific user setting.
Every single install requires that your App.Config file to be updated accordingly to each specific user setting, about: User name, password and so on.
Assumed this For what I understand, this should happen after the user have installed the software. So you have to provide a way to update the already installed App.Config file with the required user data.
Is this correct I would like to know:
when are you informed about those data? in other words, the user will communicate those infos to you after your software installation?
But you say also:
For what I know you should be able to this ... but I do not thing that it not an appropriate way to do it.What if the setup is compiled as an uncompressed directory? Can I just go into the uncompressed files and replace the app.config each time?
But in this case you are informed about this required info before that you ship the software
I'm sorry but I'm trying to understand your intentions.
Let me know.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
5aclockshadow
- Posts: 63
- Joined: Thu Feb 05, 2009 9:27 am
- Location: NJ, USA
Re: Pull app.config file from the setups current directory
If we do know the customer's connection string info, we usually find out after shipping the software.
At some point, the person who is configuring the system will have the connection string info. It could be me, one of our techs, the customer's system admin, or someone else. Typically this would be done before the customer's go live date in production.
If it is one of our techs performing the installation/configuration, I need to have documented steps in our installation guide that says "go to this file and change the default connection string info to reflect that of the customer" ... or something like that.
If it is the customer's system admin, I would love to have them either follow those directions, or send them a pre-configured file w/ their connection string.
You may ask, why not just send a custom setup for each ... sometimes customers won't have internet access. Also, not all of our techs have access to InstallAware.
I have tried to use the uncompressed directory but if I click run (or save and then run) I rec'd this:
"The program can't start because mia.lib is missing from your computer.
Try reinstalling the program to fix this problem."
Which is kind of a funny message since the user is trying to install the program, ran into an issue, message tells them to reinstall to fix the issue w/ installing it ...
My next step is to try to zip up the uncompressed directory as a self extracting zip file but I feel like this is something the InstallAware software should be able to handle.
Am I the first to ask for this?
Thanks!
At some point, the person who is configuring the system will have the connection string info. It could be me, one of our techs, the customer's system admin, or someone else. Typically this would be done before the customer's go live date in production.
If it is one of our techs performing the installation/configuration, I need to have documented steps in our installation guide that says "go to this file and change the default connection string info to reflect that of the customer" ... or something like that.
If it is the customer's system admin, I would love to have them either follow those directions, or send them a pre-configured file w/ their connection string.
You may ask, why not just send a custom setup for each ... sometimes customers won't have internet access. Also, not all of our techs have access to InstallAware.
I have tried to use the uncompressed directory but if I click run (or save and then run) I rec'd this:
"The program can't start because mia.lib is missing from your computer.
Try reinstalling the program to fix this problem."
Which is kind of a funny message since the user is trying to install the program, ran into an issue, message tells them to reinstall to fix the issue w/ installing it ...
My next step is to try to zip up the uncompressed directory as a self extracting zip file but I feel like this is something the InstallAware software should be able to handle.
Am I the first to ask for this?
Thanks!
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Pull app.config file from the setups current directory
Dear User,
This is it my only idea about your question, it is just a starting point that you could expand on your need, and I really hope that you find usefull ... I do not find any other possible.
With your setup project provide a way to run the install with a command switch that once excuted, your can script perform all required operations to fill the data required.
Example:
Your User install as usually your setup. Your setup places a extra shortcut to launch your setup with a command line option switch, say "/U".
Once ready, you provide your customer with a file that contains the required data. It could be at your choise the complete App.config or a text file, or as you prefer to code it. Then your customer executes the provide shortcut, because of the switch used, this will run a specialized script that could, copy from an already know location your file or can excute any other commads, that you find usefull to complete your task. Once done, the script will terminate closing your setup.
Hope you like.
With this scenario ... yes you are!Am I the first to ask for this?
This is it my only idea about your question, it is just a starting point that you could expand on your need, and I really hope that you find usefull ... I do not find any other possible.
With your setup project provide a way to run the install with a command switch that once excuted, your can script perform all required operations to fill the data required.
Example:
Your User install as usually your setup. Your setup places a extra shortcut to launch your setup with a command line option switch, say "/U".
Once ready, you provide your customer with a file that contains the required data. It could be at your choise the complete App.config or a text file, or as you prefer to code it. Then your customer executes the provide shortcut, because of the switch used, this will run a specialized script that could, copy from an already know location your file or can excute any other commads, that you find usefull to complete your task. Once done, the script will terminate closing your setup.
Hope you like.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
5aclockshadow
- Posts: 63
- Joined: Thu Feb 05, 2009 9:27 am
- Location: NJ, USA
Re: Pull app.config file from the setups current directory
Thanks again for the info.
If you are now saying that InstallAware does have the ability to get data from an outside source (App.config or text file) then why is the switch necessary? Why can't I just hard code it to always grab data from a certain location?
This was my original request.
All of this sounds good and sounds like it will work ... how do I do it?
Not clear on the following in your response:
"your can script perform all required operations to fill the data required."
"this will run a specialized script that could..."
"Once done, the script will terminate closing your setup."
What script?
Also, I just want to clarify that there are 2 seperate and totally independant applications here.
There is:
1.) The web app. This will already be installed via a different setup. This will be installed, configured, and running. Let's call this web app ABC.
Then within the ABC website mentioned above, there is:
2.) Another, small Setup.exe that will install a small program on client PCs. Let's call this client/server XYZ. We need the XYZ setup on the ABC website because there could be thousands of users viewing the ABC website mentioned above that may want to install the XYZ client/server app.
All I want to do is have the XYZ setup get data from an outside source. Why is a switch needed? Whatever the switch is doing, I should be able to hard code into the setup.
Please clarify and let me know how I can accomplish it (perhaps copy & paste sample code).
Thanks again!
If you are now saying that InstallAware does have the ability to get data from an outside source (App.config or text file) then why is the switch necessary? Why can't I just hard code it to always grab data from a certain location?
This was my original request.
All of this sounds good and sounds like it will work ... how do I do it?
Not clear on the following in your response:
"your can script perform all required operations to fill the data required."
"this will run a specialized script that could..."
"Once done, the script will terminate closing your setup."
What script?
Also, I just want to clarify that there are 2 seperate and totally independant applications here.
There is:
1.) The web app. This will already be installed via a different setup. This will be installed, configured, and running. Let's call this web app ABC.
Then within the ABC website mentioned above, there is:
2.) Another, small Setup.exe that will install a small program on client PCs. Let's call this client/server XYZ. We need the XYZ setup on the ABC website because there could be thousands of users viewing the ABC website mentioned above that may want to install the XYZ client/server app.
All I want to do is have the XYZ setup get data from an outside source. Why is a switch needed? Whatever the switch is doing, I should be able to hard code into the setup.
Please clarify and let me know how I can accomplish it (perhaps copy & paste sample code).
Thanks again!
-
5aclockshadow
- Posts: 63
- Joined: Thu Feb 05, 2009 9:27 am
- Location: NJ, USA
Re: Pull app.config file from the setups current directory
Any update on this?
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Pull app.config file from the setups current directory
Dear User,
Probably there was a misunderstanding.
What I suggested to you was just a track, an idea ...not the solution.
you can run an installaware setup with command line switch to perfom some actions contionally.
For example, you can run a setup.exe via command line and evaluating a passed parameter, you can do something in your script.
So what I tryed to say, suppose that you install your software, then during installation you may add a shortcut that can be called later on, once the installation it is completed. Then using this shortcut you could execute "something", by calling again your install and passing a value as command line parameter, to it. In the same way that UnInstall & Modify does in Add Remove programs, but in this case you could have an extra option that could execute something in your script and maybe can help you with your needs.
In regard to your specific case, I can't tell you more ... even because I can not understand clearly what you would do.
Regards
Probably there was a misunderstanding.
What I suggested to you was just a track, an idea ...not the solution.
you can run an installaware setup with command line switch to perfom some actions contionally.
For example, you can run a setup.exe via command line and evaluating a passed parameter, you can do something in your script.
So what I tryed to say, suppose that you install your software, then during installation you may add a shortcut that can be called later on, once the installation it is completed. Then using this shortcut you could execute "something", by calling again your install and passing a value as command line parameter, to it. In the same way that UnInstall & Modify does in Add Remove programs, but in this case you could have an extra option that could execute something in your script and maybe can help you with your needs.
In regard to your specific case, I can't tell you more ... even because I can not understand clearly what you would do.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
OhadShavit
- Posts: 4
- Joined: Tue Apr 03, 2012 6:46 am
Re: Pull app.config file from the setups current directory
Hello,
1. First your requirement is very reasonable, actually it should be the common case because it is not at all reasonable to rebuild IA project just because you change something in your installed version (configuration files, DLLs, or even exe). One should only need to rebuild IA project if he change something in the installation sequence not content (but this is unfortunately not the case with IA).
2. What i did is to use the uncompressed release. If you do that you can use the $ROOTDIR$ variable to gain an access to any file or folder that reside in the same directory as the setup.exe file. You may copy them, read them, and use their content in your script.
3. Then you can pack all setup directory with self extractable winzip, if the size matters.
4. Yet, there is still one problem, i have a reason to believe that IA have a bug in the uncompressed release, with installing prerequisites Application Runtimes. I myself am waiting for an answer for that. But if you have no prerequisites Application Runtimes, or you install them yourself from within the script, it should work for you.
5. I wish it can help you.
Ohad.
1. First your requirement is very reasonable, actually it should be the common case because it is not at all reasonable to rebuild IA project just because you change something in your installed version (configuration files, DLLs, or even exe). One should only need to rebuild IA project if he change something in the installation sequence not content (but this is unfortunately not the case with IA).
2. What i did is to use the uncompressed release. If you do that you can use the $ROOTDIR$ variable to gain an access to any file or folder that reside in the same directory as the setup.exe file. You may copy them, read them, and use their content in your script.
3. Then you can pack all setup directory with self extractable winzip, if the size matters.
4. Yet, there is still one problem, i have a reason to believe that IA have a bug in the uncompressed release, with installing prerequisites Application Runtimes. I myself am waiting for an answer for that. But if you have no prerequisites Application Runtimes, or you install them yourself from within the script, it should work for you.
5. I wish it can help you.
Ohad.
-
5aclockshadow
- Posts: 63
- Joined: Thu Feb 05, 2009 9:27 am
- Location: NJ, USA
Re: Pull app.config file from the setups current directory
Thank you for the response.
I found out the same thing ... uncompressed setup will grab the config file and I can change that config file's text. Then, I do need to create a self-extracting zip file because the users will run this setup from a website.
I feel that this is too much work for a simple task ... I plan to create a video and send it to InstallAware so it is 100% clear what I am looking for.
This seems like a simple thing that InstallAware should support natively.
Thanks again!
I found out the same thing ... uncompressed setup will grab the config file and I can change that config file's text. Then, I do need to create a self-extracting zip file because the users will run this setup from a website.
I feel that this is too much work for a simple task ... I plan to create a video and send it to InstallAware so it is 100% clear what I am looking for.
This seems like a simple thing that InstallAware should support natively.
Thanks again!

