Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

I am using NSIS. Which setup should I include with my installer?
newahkow
#1 Posted : Tuesday, October 11, 2011 4:45:13 AM(UTC)
Groups: Member
Joined: 10/11/2011(UTC)
Posts: 19

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Hi all,

I have read this page: http://ultidev.com/Forum...sing-Visual-Studio.aspx

But I am using NSIS as installer, so which setup should I include with my application?
Is it the complete "UltiDev Web Server Setup.exe" or just "Redist\Visual Studio\UltiDev.WebServer.msi"?
They seem to install the same files but I just want to confirm.

If the answer is "UltiDev Web Server Setup.exe", how do I install it without user having to click "I Agree" etc?

Thank you very much.
Ultidev Team
#2 Posted : Tuesday, October 11, 2011 10:15:53 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

You are probably better off shipping MSI instead of EXE. MSI can be installed using existing Windows program called MSIEXEC.EXE with /quiet command line parameter to ensure UWS installer does not require user interaction.

If your installer can download components from the web, latest version of the UWS installer is always at
Quote:
http://download.ultidev.com/Products/Cassini/Pro/UltiDev.WebServer.msi


Your installer may try to download it first, and if it can't, it can install the build attached to your application installer.

Please let us know if this information was helpful.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
1 user thanked Ultidev Team for this useful post.
newahkow on 10/11/2011(UTC)
newahkow
#3 Posted : Wednesday, October 12, 2011 4:46:43 AM(UTC)
Groups: Member
Joined: 10/11/2011(UTC)
Posts: 19

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
That was helpful, thanks!
Ultidev Team
#4 Posted : Wednesday, October 12, 2011 9:38:10 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
You are most welcome!

Please post here about your experience with making an NSIS installer incorporating UWS. It could be very helpful for fellow developers.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
newahkow
#5 Posted : Wednesday, October 12, 2011 10:09:07 PM(UTC)
Groups: Member
Joined: 10/11/2011(UTC)
Posts: 19

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
We included UltiDev.WebServer.msi in our NSIS installer. When installing, it is copied to the program directory, eg: c:\program files\MyApp

The NSIS script looks something like this:
Code:

Section "My App" Section_MyApp
SectionIn 1 2 3 4 5
DetailPrint "Installing MyApp..."
; copy your app including UltiDev.WebServer.msi to c:\program files\MyApp
SectionEnd

Section "UltiDev Web Server Pro" Section_WebServer
SectionIn 1 2 3 4 5
DetailPrint "Installing UltiDev Web Server Pro..."

; Install the msi using msiexec, use /passive and /i to install automatically
ExecWait 'msiexec.exe /passive /i "UltiDev.WebServer.msi"'

; Register the web application, replace {FFFF...} with your own GUID
ExecWait '"$PROGRAMFILES\UltiDev\Web Server\UWS.RegApp.exe" /r /AppId={FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF} /path:"$APPDATA\Company\Product\Web" /ddoc:default.aspx /appname:"My App" /clr:4 /vpath:"/"'

SectionEnd

Section Uninstall
; Unregister web application, replace {FFFF...} with your own GUID, it should be the same GUID you use above
ExecWait '"$PROGRAMFILES\UltiDev\Web Server\UWS.RegApp.exe" /unreg /appid={FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}'

;NOTE: Do not uninstall UltiDev Web Server Pro, since it may be installed and used by other applications. Let user uninstall themselves.

DetailPrint "Deleting Files..."
; delete shortcuts and MyApp

SectionEnd
1 user thanked newahkow for this useful post.
Ultidev Team on 10/12/2011(UTC)
Ultidev Team
#6 Posted : Wednesday, October 12, 2011 10:20:32 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Thank you for sharing this information, it no doubt will be useful for fellow developers using NSIS and UWS!

We apologize for the editing inconvenience. YAF forum engine apparently has a bug in the editor. Manual BB coding still works though.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
newahkow
#7 Posted : Thursday, October 13, 2011 1:51:12 AM(UTC)
Groups: Member
Joined: 10/11/2011(UTC)
Posts: 19

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Surrounded the script with [code], but apparently the result html does not use <pre>.
Ultidev Team
#8 Posted : Thursday, October 13, 2011 8:32:36 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Thank you nonetheless! Word wrapping is not too confusing.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
cjmcgee
#9 Posted : Wednesday, January 4, 2012 6:09:20 PM(UTC)
Groups: Member
Joined: 1/4/2012(UTC)
Posts: 16
Location: Raleigh, NC

I am also using NSIS. I have two additional needs when installing not covered by the suggestion above.

1) I would like to check if the current version is already installed before calling msiexec.exe /passive /i "UltiDev.WebServer.msi"

Is there somewhere in the registry I can check (or elsewhere) to see if Web Server Pro is already installed and what version is installed?

2) I would like to be able to install to a different drive. Some of our customers have very little space on the C drive so need to be able to choose which drive things are installed on.

Does the msi take any optional parameters for install directory? Something like "msiexec.exe /passive /i UltiDev.WebServer.msi InstallDirectory=D:\InstallHere"?


Thanks!
Ultidev Team
#10 Posted : Wednesday, January 4, 2012 9:26:30 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

1) Since UWS is being updated pretty often, in order to decide whether to try installing UWS you would have to check not only whether current version of UWS is installed, but also whether newer version is installed. If you would like to do that, we can provide guidance on how to do this. However, the best way to handle the issue is to have your setup bootstrapper always download latest version of UWS from http://download.ultidev....o/UltiDev.WebServer.msi and let it run: it will do all the necessary checks and installed the latest one if necessary. Even if you package some UWS build along with your product, then you can too just let it run: it won't hurt if it finds the same or newer version already installed and it's pretty quick too, and allows you to not do necessary checks yourself.

2) Unfortunately that's not possible. UWS always gets installed in the well-known location of %ProgramFiles% folder, so multiple application installers can find it in the same place. Also, UWS takes only 4MB on disk - a tiny amount of space in the era of multi-terabyte drives.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
cjmcgee
#11 Posted : Thursday, January 5, 2012 10:40:29 AM(UTC)
Groups: Member
Joined: 1/4/2012(UTC)
Posts: 16
Location: Raleigh, NC

We don't really want to pull the latest since we may not have validated with that version yet. Anyways, below is what we are using now. We let the user choose to use IIS if it is available otherwise we install UWS. The code below is a little bit simplified in that it does not show the user selection part.

Code:

var IISAvailable

; check if IIS 5.0 or later is available
Function CheckIIS
    StrCpy $IISAvailable "N"

    ClearErrors
    ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\InetStp" "MajorVersion"
    ReadRegDWORD $1 HKLM "SOFTWARE\Microsoft\InetStp" "MinorVersion"

    IfErrors DoneIISCheck

    IntCmp $0 5 iis5orLater DoneIISCheck iis5orLater

    iis5orLater:
        StrCpy $IISAvailable "Y"

    DoneIISCheck:
        Return
FunctionEnd



Section
    ; section where you want web server installed
    
    ${If} $IISAvailable == "N"
        SetOutPath $INSTDIR
        File "UltiDev Web Server Pro\UltiDev.WebServer.msi"

        DetailPrint "Installing UltiDev Web Server Pro"
        ExecWait 'msiexec.exe /passive /i "$INSTDIR\UltiDev.WebServer.msi"'
    ${EndIf}

    ; ...

    ; Unregister website to make sure no files are in use by webserver while upgrading
    ; and to pick up any changes in how we register it now
    ${If} $IISAvailable == "N"
        DetailPrint "Unregistering Website"
        ExecWait '"$PROGRAMFILES\UltiDev\Web Server\UWS.RegApp.exe" /unreg /AppID:$WebsiteAppID'
    ${EndIf}

    ; ...

    ; Register the website
    ${If} $IISAvailable == "N"
        ExecWait '"$PROGRAMFILES\UltiDev\Web Server\UWS.RegApp.exe" /reg /AppID:$WebsiteAppID "/vdir:MyApp" /clr:4 /force32biton64 "/EndPoints:http://*:$WebsitePort/" "/Folder:$INSTDIR\Website" /AppName:$AppName /host:SharedNetworkService "/AppDesc:$AppDescription" /DefaultDocument:Main.aspx'
    ${EndIf}

    ; ...

    ; setup your shortcuts, making sure to put in the port you used when using UWS
    ${If} $UseIIS == "Y"
        CreateShortCut "$DESKTOP\MyApp.lnk" "$PROGRAMFILES\Internet Explorer\iexplore.exe" "http://localhost/MyApp"
        CreateShortCut "$SMPROGRAMS\MyApp\MyApp.lnk" "$PROGRAMFILES\Internet Explorer\iexplore.exe" "http://localhost/MyApp" "$PROGRAMFILES\Internet Explorer\iexplore.exe" 0
    ${Else}
        CreateShortCut "$DESKTOP\MyApp.lnk" "$PROGRAMFILES\Internet Explorer\iexplore.exe" "http://localhost:$WebsitePort/MyApp"
        CreateShortCut "$SMPROGRAMS\MyApp\MyApp.lnk" "$PROGRAMFILES\Internet Explorer\iexplore.exe" "http://localhost:$WebsitePort/MyApp" "$PROGRAMFILES\Internet Explorer\iexplore.exe" 0
    ${EndIf}
    
    ; ...

SectionEnd

Section "Uninstall"

    ; ...

    ClearErrors
    ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\InetStp" "MajorVersion"
    ReadRegDWORD $1 HKLM "SOFTWARE\Microsoft\InetStp" "MinorVersion"

    IfErrors doneIIS
    ; do uninstall of website from IIS here

    doneIIS:

    ClearErrors
    ${DirState} "$PROGRAMFILES\UltiDev\Web Server" $R0
    IfErrors doneUWS
    StrCmp $R0 "-1" doneUWS 0

    ; found UWS installed, try to unregister
    ; this will silently fail if this app ID is not registered
    ExecWait '"$PROGRAMFILES\UltiDev\Web Server\UWS.RegApp.exe" /unreg /AppID:$WebsiteAppID'

    ; not uninstalling UWS

    doneUWS:    

    ; ...

SectionEnd

Ultidev Team
#12 Posted : Thursday, January 5, 2012 11:39:07 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hello!

It looks good: since you are packaging UWS as a part or your application installer, it makes sense to do what you do - simply run it. UWS installer will quit pretty quickly if it finds same or newer version of itself already installed. Since UWS does not write its currently-installed version into the registry, determining the version of UWS could be pretty hairy, and involve using MSI APIs to get current product code from the upgrade code, and then the version number by product code - all of which will take about as much time as simply running UWS installation.

Also, not having validated the latest version of UWS may be moot on some systems: if newer version of the UWS is already installed on the target system, you (and us) have to be able to support it, so in general we tend to release subsequent versions of UWS with fewer bugs than the previous one.

Finally, we noticed that you seem to let users choose the TCP port. We would like to point out that while it's alright for highly-technical users, regular users cannot be expected to know which ports are free and even what TCP port is. We recommend in addition to specifying your desired hard-coded port, always place your application on UWS-assigned free port and use UWS redirector application to create a port-independent URL taking users to your application.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
bwoodworth
#13 Posted : Monday, February 4, 2013 8:51:55 PM(UTC)
Groups: Member
Joined: 2/4/2013(UTC)
Posts: 3
Location: California

This is invaluable info for integrating into an NSIS install. Thanks for posting! One question, where do I find the .msi for UWS? I only see the .exe on the downloads page.
Ultidev Team
#14 Posted : Tuesday, February 5, 2013 10:39:15 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi!

Redistributable MSI is at "C:\Program Files\UltiDev\Web Server\Redist\Visual Studio\UltiDev.WebServer.msi".

Please let us know if this information was helpful.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.