We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Importing web site from VS

I just discovered AdvancedInstaller and I am still exploring most of the settings. However, this is not going very well since I haven't been able to create a functional installer yet.

I have a Web Application created in Visual Studio. I used to have setup projects, but with VS2012 I can't have those anymore. So I added a AI Setup Project to my solution. When I get into the AI tool, I click on the Import -> Visual Studio Project button. I select my Solution and Build and then the tool automatically suggests which dependencies it should add. So far so good. However, I then get 2 problems. First is that only the DLLs are imported and nothing else (what about web pages, config files and so on?). Second, no web site is created, I'm guessing the tool thinks I'm creating a windows application. If I add a website manually, of course it only contains the DLLs previously found and nothing else. I can add the whole contents of my project using the Files And Folders tab, but of course this does not work once installed.

I'm guessing there is something else I must do when importing, but I just can't find what it is.

Thanks in advance
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Importing web site from VS

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can follow our "IIS Tutorial" article steps. Also, you can take a look on our "IIS how to's" articles.

Let us know if this helps, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Re: Importing web site from VS

Hi

Thanks for the reply. I did see this first tutorial the first time around but it did not meet my biggest concern, which is before step 1 : the files included in the deployment when I click on Import are just the DLL/EXE. But this time I took the time to add everything manually and read the other steps carefully (I was missing a permission step at first), so I got my web project to work at least. I'm confident it's the same for services.

So anytime I do a modification in the project, such as add a page or change a DLL reference, I had to re-do the setup steps, including re-making the files/folders hierarchy. Also, there are files which should be deployed and some not (code-behind files versus the images for example), Visual Studio used to sort this out automatically. Do you have any clue why this happens to me? I thought Advanced Installer was going to manage these things automatically and from what I read in previous posts it looks like it is indeed supposed to.


Also, if you find this before I do, please tell me. I created a project which includes an installerclass. I added properties in the setup project, such as WebConfigUsername. I display them in message boxes in a custom action inline script (VB) and it works. But when I send the same properties to the custom action installer class and display message boxes, the properties are empty.
Action Data :

Code: Select all

 /LogFile= /ReqVersion=4.0.30319 /InstallType=notransaction /Action=Install /WebConfigUsername="[PROPERTYUSERNAME]" /WebConfigPassword="[PROPERTYPASSWORD]" /WebConfigTarget="[APPDIR]" "[#ClassLibrary1.dll]" "[TempFolder]NetInstallerClass_Config.xml"
Installerclass code:

Code: Select all

public override void Install(IDictionary stateSaver)
        {            
            string username = Context.Parameters["WebConfigUsername"];
            string password = Context.Parameters["WebConfigPassword"];
            string webconfigPath = Context.Parameters["WebConfigTarget"];

            MessageBox.Show("username : " + username);
            MessageBox.Show("password : " + password);
            MessageBox.Show("webconfigPath : " + webconfigPath);
       }
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Importing web site from VS

Hello,
So anytime I do a modification in the project, such as add a page or change a DLL reference, I had to re-do the setup steps, including re-making the files/folders hierarchy. Also, there are files which should be deployed and some not (code-behind files versus the images for example), Visual Studio used to sort this out automatically. Do you have any clue why this happens to me? I thought Advanced Installer was going to manage these things automatically and from what I read in previous posts it looks like it is indeed supposed to.
I'm afraid we don't have support for this. Please note that when importing a Visual Studio solution Advanced Installer imports only the primary output of your VS project. So, in order to achieve what you want you should manually add the rest of required files. We'll try to add an improvement regarding this in a future version of Advanced Installer, thank you for your suggestion.
Also, if you find this before I do, please tell me. I created a project which includes an installerclass. I added properties in the setup project, such as WebConfigUsername. I display them in message boxes in a custom action inline script (VB) and it works. But when I send the same properties to the custom action installer class and display message boxes, the properties are empty.
I'm not sure why this happens. Can you please send us a verbose log of the installation to support at advancedinstaller dot com so we can investigate it?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Re: Importing web site from VS

Hi again. Just a quick update on the original issue of this thread : it looks like there is a way! I found that, for websites, the good old "Deploy" projects from Visual Studio had a lot of files in their "Release" folder. I did not see this the first time because this used to be left unused by the Visual Studio setup projects. I'm not done testing this yet, but so far this Release folder is a perfect match of what I want to deploy.

EDIT : actually, Deploy projects are not available anymore (VS2012), but Publish does the same thing : right-click on the project, Publish Web Site, select destination. These are the files to be deployed, including the Bin folder as necessary.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Importing web site from VS

Hello,

Thank you for sharing this with us. I'm sure this will help future users in the same situation.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Re: Importing web site from VS

Hi

Sorry if I don't always provide an example quickly, I'm jumping form feature to feature to see what works and how to use it and don't have much time to look back.

Actually, with my latest test I needed to come back to .Net installer class custom actions. And it worked this time...mostly (I still have no idea why it didn't work before). I am now able to pass the parameters, with some exceptions. Passing some properties such as APPDIR make the setup crash with an error that looks like the parameter "line" got screwed up :

Code: Select all

Error 1001. Error 1001. Usage: InstallUtil [/u | /uninstall] [option [...]] assembly [[option [...]] assembly] [...]]
I did some testing, such as hardcoding its value (worked) and copying its value into another property (crashes) and I came to the conclusion that the backslashes in the APPDIR path are probably used as escape characters, meaning they should be "doubled" in order to be used. And I tried doing this using the Set Installer Property custom action, but didn't find a way to double the backslashes. If I hardcode the path, it will pass the value to the installerclass with "doubled" backslashes, but of course I want to use the property and not hardcode. Is there a workaround or solution for this?

And it turns out I'm back to the drawing board with the Import when it comes to services : the Publish button in VS creates a setup instead of publishing the needed files, so I need another way to get them. Still using the Release folder until I come up with something better.
EDIT : oh hey, look at that, with some little tweaking in its Publish tab the service project will output all the necessary files in a sub-folder of the Publish's result!
Last edited by mstarnaud on Tue Apr 30, 2013 4:56 pm, edited 1 time in total.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Importing web site from VS

Hello,
I did some testing, such as hardcoding its value (worked) and copying its value into another property (crashes) and I came to the conclusion that the backslashes in the APPDIR path are probably used as escape characters, meaning they should be "doubled" in order to be used. And I tried doing this using the Set Installer Property custom action, but didn't find a way to double the backslashes. If I hardcode the path, it will pass the value to the installerclass with "doubled" backslashes, but of course I want to use the property and not hardcode. Is there a workaround or solution for this?
Please take a look on our "[APPDIR] with .Net Installer" thread which debates a similar issue.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Re: Importing web site from VS

Oh yes now I remember seeing this thread before. I should have thought about adding that space, it's obvious now that I think about it. And so it works now. And so does importing from VS' publish.

Thank you.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Importing web site from VS

You're welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”