swanseahost
Posts: 30
Joined: Sat Dec 26, 2009 2:45 pm

Not a problem - New User Question

Hi there,

I am new to all this setup creation so please be gentle :)

I currently have a batch file that installs Windows Server 2008 Roles, some software to a folder and shortcuts on desktop etc. I would like to create 1 setup file that would do the following

1) Detect OS type
2) Install Main component on 1 server
3) Install Sub component on all other servers
4) Install some services
5) Configure users to local admins

Is this possible ? Should I paste the batch file here ?

Thanks
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Not a problem - New User Question

Hi,
1) Detect OS type
For this you can use the VersionNT property
2) Install Main component on 1 server
3) Install Sub component on all other servers
I'm not sure about what this process involves. Can you please give me more details? Eventually, if there isn't support for it, you can use a BAT file through a Launch file or open URL custom action.
4) Install some services
You can try using the Services page. The User Guide contains a service tutorial which may help you.
5) Configure users to local admins
Can you please give me more details about this?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
swanseahost
Posts: 30
Joined: Sat Dec 26, 2009 2:45 pm

Re: Not a problem - New User Question

Hi there,

Thanks for the reply. I would need 1 x setup file to install 2 options.

1) Protect Server - These are currently the batch files that work but it would be nice if I could use a setup program instead. I currently have 8 batch files dependant on the OS type. Ie Windows 2008, Windows 2008 R2, Windows 2008/2003 32/64 bit. It would be nice it the setup program could detect the version then run the code.

2) Source Server

I will post the batch files for these tomorrow as I don't have them with me right now.

I have looked through the features of your product and I believe there is a client/server setup ???

Thanks
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Not a problem - New User Question

Hi,
These are currently the batch files that work but it would be nice if I could use a setup program instead. I currently have 8 batch files dependant on the OS type. Ie Windows 2008, Windows 2008 R2, Windows 2008/2003 32/64 bit. It would be nice it the setup program could detect the version then run the code.
Since the batch files run commands, I'm not sure how they could be replaced in the installation process. It depends a lot on what the commands do. A good approach would be to launch the files during install using a custom action like I mentioned in my previous post.
I have looked through the features of your product and I believe there is a client/server setup ???
Yes, we have a predefined template for this. However, I'm not sure if it will help you because the template is designed for applications which run on a server, but has client components as well. If you're installing only on a server you can use a regular project.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
swanseahost
Posts: 30
Joined: Sat Dec 26, 2009 2:45 pm

Re: Not a problem - New User Question

Hi there,

Thanks for the repy. I have also seen Setup Factory and they can do it... However, not impressed with their product. Here are the batch files as promised.

Protect Server Batch File

@echo off
REM Installer V2.01 - Steve James 21st November 2009

REM Start install and copy files to appropriate folders
Echo Copying Files ...
mkdir c:\protect
xcopy protect\*.* c:\protect /s /i
xcopy "Protect Server\wwwroot\*.*" c:\inetpub\wwwroot /s /i
copy c:\protect\reg\regentry.bat "c:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\regentry.bat"
copy c:\protect\reg\regentry.bat "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\regentry.bat"
copy c:\protect\reg\Getip.bat "c:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Getip.bat"
copy c:\protect\reg\Getip.bat "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\Getip.bat"
echo %date% %time% Files have been copied sucessfully > c:\protect\logs\installer.txt

REM Set Password and Add Recovery User to Local Admins
Echo Creating Users ...
echo "Please Enter Customer Password for Recovery User"
set /p Password=
net user recovery %Password% /add
net localgroup "administrators" recovery /add
net user protect Ogldrt35t /add
net localgroup "administrators" protect /add
echo %date% %time% User recovery and protect created >> c:\protect\logs\installer.txt

REM Set Passwords No Expire
Echo Setting Passwords to NOT Expire ...
wmic path Win32_UserAccount where Name='administrator' set PasswordExpires=false
wmic path Win32_UserAccount where Name='recovery' set PasswordExpires=false
wmic path Win32_UserAccount where Name='protect' set PasswordExpires=false
echo %date% %time% Password Set To No Expire >> c:\protect\logs\installer.txt

REM Install IIS 7 On Windows 2008
Echo Installing IIS 7 ...
%windir%\Sysnative\servermanagercmd.exe -install Web-Server -a
echo %date% %time% IIS 7 installed sucessfully >> c:\protect\logs\installer.txt

REM Install Powershell
Echo Installing Powershell ...
%windir%\Sysnative\servermanagercmd.exe -install powershell
echo %date% %time% Powershell installed sucessfully >> c:\protect\logs\installer.txt

REM Set Execution Policy Unrestricted
Echo Setting Execution Policy ...
%windir%\Sysnative\WindowsPowerShell\v1.0\powershell.exe -command Set-ExecutionPolicy Unrestricted
echo %date% %time% Execution policy set sucessfully >> c:\protect\logs\installer.txt

REM Install .net framework 3
Echo Installing .Net Framework 3 ...
%windir%\Sysnative\servermanagercmd.exe -install NET-Framework
echo %date% %time% .Net Framework 3 installed sucessfully >> c:\protect\logs\installer.txt

REM Install .net framework 3.5
Echo Installing .Net Framework 3.5 ...
"Common\dotnetfx35.exe"
echo %date% %time% .Net Framework 3.5 installed sucessfully >> c:\protect\logs\installer.txt

REM Install SNMP Services
Echo Installing SNMP Services ...
%windir%\Sysnative\servermanagercmd.exe -install SNMP-Services
echo %date% %time% SNMP Services installed sucessfully >> c:\protect\logs\installer.txt

REM Register DLL Files
Echo Registering DLL Files ...
C:\Windows\Microsoft.NET\Framework\v2.0.50727\installutil.exe /LogFile= /InstallStateDir="c:\protect" "c:\protect\lib\System.Management.Automation.dll"
echo %date% %time% .DLL registered sucessfully >> c:\protect\logs\installer.txt

REM Install Hyper-V on Windows 2008
Echo Installing Hyper-V ...
%windir%\Sysnative\servermanagercmd.exe -install hyper-v
echo %date% %time% Hyper-V installed sucessfully >> c:\protect\logs\installer.txt

REM Copy Shortcuts
Echo Copying Shortcuts ...
copy "Protect Server\Shortcuts\*.lnk" "c:\users\administrator\desktop"
xcopy "Protect Server\Remote Monitoring\*.*" "c:\users\administrator\desktop\Remote Monitoring" /s /i
echo %date% %time% Shortcuts copied sucessfully >> c:\protect\logs\installer.txt

REM Disable Windows Firewall
Echo Disabling Firewall ...
netsh firewall set opmode disable
echo %date% %time% Windows Firewall Disabled >> c:\protect\logs\installer.txt

REM Enable RDP
Echo Enabling RDP ...
regedit /s "c:\protect\reg\enablerdp.reg"
echo %date% %time% RDP Enabled >> c:\protect\logs\installer.txt

REM Install OGL Protect Services
Echo Installing OGL Protect Services ...
c:\windows\Microsoft.NET\Framework\v2.0.50727\installutil /LogFile= /InstallStateDir="c:\protect" "c:\protect\bin\OGL protect backup.exe"
c:\windows\Microsoft.NET\Framework\v2.0.50727\installutil /LogFile= /InstallStateDir="c:\protect" "c:\protect\bin\OGL protect diagnostics.exe"
c:\windows\Microsoft.NET\Framework\v2.0.50727\installutil /LogFile= /InstallStateDir="c:\protect" "c:\protect\bin\OGL protect disk mounter.exe"
echo %date% %time% OGL protect services installed sucessfully >> c:\protect\logs\installer.txt

REM Install Visual C Reqs
Echo Install Visual C++ Files
"Common\VisualC\vcredist_x86.exe" /q
"Common\VisualC\vcredist_x64.exe" /q

REM Install DoubleTake
Echo Installing DoubleTake ...
"Common\dbltake x64\setup\dtsw\x64\setup.exe"
echo %date% %time% Double Take Installed sucessfully >> c:\protect\logs\installer.txt

REM Registry Entries
Echo Inserting Registry Entries ...
regedit /s "c:\protect\reg\ogldisk.reg"
regedit /s "c:\protect\reg\dtdepend.reg"
echo %date% %time% Registry Entries installed successfully >> c:\protect\logs\installer.txt

REM Install Winimage
Echo Installing WinImage ...
"Protect Server\wisetup.exe"
echo %date% %time% WinImage Installed Successfully >> c:\protect\logs\installer.txt

REM Change Computer Name To ProtectPlus
Echo Changing Computer Name ...
"Protect Server\computername.vbs"
echo %date% %time% Computer Name Changed to ProtectPlus >> c:\protect\logs\installer.txt

REM Configure IE (Remove nag screen, disable IE ESC, sets home page to 127.0.0.1/protect.asp
Echo Configuring Internet Explorer Home Page ...
REM Backup registry keys
REG EXPORT "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" "%TEMP%.HKEY_LOCAL_MACHINE.SOFTWARE.Microsoft.Active Setup.Installed Components.A509B1A7-37EF-4b3f-8CFC-4F3A74704073.reg"
REG EXPORT "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" "%TEMP%.HKEY_LOCAL_MACHINE.SOFTWARE.Microsoft.Active Setup.Installed Components.A509B1A8-37EF-4b3f-8CFC-4F3A74704073.reg"
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" /v "IsInstalled" /t REG_DWORD /d 0 /f
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" /v "IsInstalled" /t REG_DWORD /d 0 /f
Rundll32 iesetup.dll, IEHardenLMSettings
Rundll32 iesetup.dll, IEHardenUser
Rundll32 iesetup.dll, IEHardenAdmin
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" /f /va
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" /f /va
REM Optional to remove warning on first IE Run and set home page to blank.
REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "First Home Page" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Default_Page_URL" /t REG_SZ /d "http://127.0.0.1/protect.asp" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d "http://127.0.0.1/protect.asp" /f
echo %date% %time% IE Configured and Home Page Setup - 127.0.0.1/protect.asp >> c:\protect\logs\installer.txt

REM Restart Windows 2008 in 30 Seconds
Echo Restarting Windows ...
shutdown -r
echo %date% %time% Server has been set to restart sucessfully >> c:\protect\logs\installer.txt

REM Disable UAC
Echo Disabling UAC ...
C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
echo %date% %time% Windows UAC Disabled >> c:\protect\logs\installer.txt

Source Server Batch File

@echo off
net user protect Ogldrt35t /add
net localgroup "administrators" protect /add
mkdir c:\protect
copy "OGL*.*" c:\protect
copy Pool*.* c:\protect
net share protect="c:\protect" /GRANT:protect,FULL
CACLS c:\protect /E /G protect:F
wmic path Win32_UserAccount where Name='protect' set PasswordExpires=false
xcopy "..\protect\bin\ogl*.*" c:\protect /s /i
"..\Common\VisualC\vcredist_x86.exe" /q
"..\Common\VisualC\vcredist_x64.exe" /q
REM "..\Common\dotnetfx35.exe"
%windir%\Sysnative\servermanagercmd.exe -install NET-Framework
"..\Common\dbltake x32\setup\dtsw\i386\setup.exe"
c:\windows\Microsoft.NET\Framework\v2.0.50727\installutil.exe /LogFile= /InstallStateDir="c:\protect" "OGL protect failover helper.exe"
REGEDIT /S c:\protect\ogldisk.reg
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Not a problem - New User Question

Hi,

1. For copying files and folders and creating shortcuts you can use the Files and Folders page. Here you can also set permissions. Friendlier permission options will be included in the next release.
2. To create and configure user accounts and groups you can use the Users and Groups page.
3. Advanced Installer doesn't have a built-in feature for configuring roles, but you can use "servermanagercmd.exe" through custom actions.
4. For setting the execution policy on Powershell you can use a custom action.
5. .NET Framework, Visual C++ Redistributables, DoubleTake and WinImage can be added as prerequisites.
6. You can register files through the auto register feature in the "Files and Folders" page.
7. For disabling the Windows Firewall you can use the Install Options tab of the Windows Firewall page.
8. The .REG files can be imported in the Registry page so they are handled by Windows Installer. In this page you can also create registry entries or configure registry entry removals. For backing up registry entries you can try the approach from the Preserve registry key at install how-to.
9. For installing OGL Protect Services you can use a custom action.
10. The VBScript which changes the computer name can be added as an attached custom action.
11. For disabling the UAC you can use a custom action or a registry entry.
12. You can reboot the machine after install by using the "Reboot Behavior" combo from the Install Parameters page.

I hope I didn't miss anything. Basically, you can use Advanced Installer for what you need. The Windows Firewall feature requires an Enterprise license, but if you use a custom action the rest can be done with a Professional license. If you have questions or you encounter problems, don't hesitate to ask.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
swanseahost
Posts: 30
Joined: Sat Dec 26, 2009 2:45 pm

Re: Not a problem - New User Question

Hi there,

Thank you for the reply... One thing...

On the protect server there are two options that need an AutoDetect of some nature. Windows 2008 and Windows 2008 R2. .NET Framework will only install via servermanagercmd in 2008 R2. So I would need the installer to detect what version and then either run .net setup or servermanagercmd -install Net-Framework.

For the source servers it would be the same scenario except it needs to detect OS type either 32/64 bit.

Thanks
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Not a problem - New User Question

Hi,

Please note that the User Guide contains the Install resources based on the OS version how-to which may help you. For Windows Server 2008 R2 the VersionNT property is set to 601. With VersionNT and VersionNT64 you can condition custom actions and feature-based prerequisites.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
swanseahost
Posts: 30
Joined: Sat Dec 26, 2009 2:45 pm

Re: Not a problem - New User Question

Hi there,

Basically I would need 1 installer with 2 options

1 Protect Server Will always be Windows 2008 or Windows 2008 R2 64 Bit
1 Source Server Either Windows 2003/2008/2008 R2 both 32 and 64 bit

Common (Need to be installed on both)
Userconfig.bat
vcredist 32 & 64 (Protect Server) 32 or 64 bit needs to install on source based on source server os ver & type
.Net Framework 3.5 based on Windows 2008 or Windows 2008 R2
DT 32 or 64 based on OS Type

c:\protect folder for both installs

2 x folders in Source
1 x service

6 x folders in protect
3 x service

What project type would be best ? What project would I need for this ? Can it be done in 1 install file ? I have a working LUA Script that I created when I demo Setup Factory (Another product) Would you like to see that perhaps that would make it clearer ?

Thanks
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Not a problem - New User Question

Hi,
What project type would be best ?
If you don't need to use the Windows Firewall feature (I noticed you were stopping it in the BAT), you can create a Professional project.
Can it be done in 1 install file ?
Yes. I explained in one of my previous posts what features you can use. The package can contain elements for all Windows Server 2008 types (regular, R2, 32-bit, 64-bit) and these elements can be conditioned with the "VersionNT" and "VersionNT64" properties. Based on these properties only some of the package elements will be installed.

For example, in the Organization page you can create two features (one for protect and one for source) and organize the components (move the components of the protect installation to the protect feature and the components of the source installation to the source feature). After that, you can condition the components with VersionNT and VersionNT64 like explained in the how-to I mentioned. Instead of conditioning the components you can also use conditional install levels for your features.
I have a working LUA Script that I created when I demo Setup Factory (Another product) Would you like to see that perhaps that would make it clearer ?
Perhaps there is a miscommunication. I understand what you need to do. Did you try using the features I mentioned? Adding the files and folders in the "Files and Folders" page, configuring services through the "Services" page, adding feature-based prerequisites etc.? Do you need more details?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
swanseahost
Posts: 30
Joined: Sat Dec 26, 2009 2:45 pm

Re: Not a problem - New User Question

I have only used your product for a couple of days and it is $999 for the software which I dont mind paying for. I am not a programmer and find it a little hard to get my head around things so I am sorry about that. I understand that you can create features etc. Is it possible you could send me a template of what you mean ? Or can I send you my LUA script so you can see what is happening ?

Thanks
swanseahost
Posts: 30
Joined: Sat Dec 26, 2009 2:45 pm

Re: Not a problem - New User Question

Question 1 as above in last post

Question 2 Do you offer a service or can you recommend somone to create a template for me ?

Thanks
swanseahost
Posts: 30
Joined: Sat Dec 26, 2009 2:45 pm

Re: Not a problem - New User Question

Hi there,

Here is my LUA script. Where would I look to do this on Advanced Installer ?

-- Assign Variables
bprotectserver = SetupData.GetPackageProperties("ProtectServer").Install
bsourceserver = SetupData.GetPackageProperties("SourceServer").Install

-- Common Install Tasks
-- UserConfig.bat adds the users, sets passwords, shares protect folder, disables firewall
File.Run(SessionVar.Expand("c:\\protemp\\UserConfig.bat"), "", "", -1, true);
if System.GetOSName() == "Windows Server 2008 R2" then
File.Run(_WindowsFolder.."\\Sysnative\\servermanagercmd.exe", "-install Net-Framework", "", -1, true);
else
File.Run(SessionVar.Expand("c:\\protemp\\dotnetfx35.exe"), "/q /norestart", "", SW_SHOWNORMAL, true);
end
if System.Is64BitOS() then
File.Run(SessionVar.Expand("c:\\protemp\\vcredist_x64.exe"), "/q", "", -1, true);
File.Run(SessionVar.Expand("c:\\protemp\\vcredist_x86.exe"), "/q", "", -1, true);
File.Run(SessionVar.Expand("c:\\protemp\\DT64\\setup.exe"), "", "c:\\protemp", SW_SHOWNORMAL, true);
else
File.Run(SessionVar.Expand("c:\\protemp\\vcredist_x86.exe"), "/q", "", -1, true);
File.Run(SessionVar.Expand("c:\\protemp\\DT32\\setup.exe"), "", "c:\\protemp", SW_SHOWNORMAL, true);
end

-- Choose Installation based on User Selection
if bprotectserver then
File.Copy(SessionVar.Expand("%AppFolder%\\Extras\\Reg\\GetIP.bat"), "c:\\Users\\Administrator\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup", true, true, false, true, nil);
File.Copy(SessionVar.Expand("%AppFolder%\\Extras\\Reg\\GetIP.bat"), "c:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup", true, true, false, true, nil);
File.Copy(SessionVar.Expand("%AppFolder%\\Extras\\Reg\\reboot.bat"), "c:\\Users\\Administrator\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup", true, true, false, true, nil);
File.Copy(SessionVar.Expand("%AppFolder%\\Extras\\Reg\\reboot.bat"), "c:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup", true, true, false, true, nil);
File.Run(_WindowsFolder.."\\Sysnative\\servermanagercmd.exe", "-install Web-Server -a", "", -1, true);
File.Run(_WindowsFolder.."\\Sysnative\\servermanagercmd.exe", "-install SNMP-Services", "", -1, true);
if System.GetOSName() ~= "Windows 2008 R2" then
File.Run(_WindowsFolder.."\\Sysnative\\servermanagercmd.exe", "-install Powershell", "", -1, true);
end
File.Run(_WindowsFolder.."\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe", "-command Set-ExecutionPolicy Unrestricted", "", SW_SHOWNORMAL, true);
File.Run("c:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\installutil.exe", "c:\\protect\\lib\\System.Management.Automation.dll", "", -1, true);
Service.Create("c:\\protect\\bin\\OGL protect backup.exe", "OGL protect backup", "OGL protect backup", SERVICE_WIN32_OWN_PROCESS, false, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, "", nil, nil, "", "");
Service.Create("c:\\protect\\bin\\OGL protect diagnostics.exe", "OGL protect diagnostics", "OGL protect diagnostics", SERVICE_WIN32_OWN_PROCESS, false, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, "", nil, nil, "", "");
Service.Create("c:\\protect\\bin\\OGL protect disk mounter.exe", "OGL protect disk mounter", "OGL protect disk mounter", SERVICE_WIN32_OWN_PROCESS, false, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, "", nil, nil, "", "");
File.Run(_WindowsFolder.."\\Sysnative\\servermanagercmd.exe", "-install Hyper-V", "", -1, true);
File.Run(SessionVar.Expand("%AppFolder%\\Extras\\wisetup.exe"), "", "", SW_SHOWNORMAL, true);
File.Run(_WindowsFolder.."\\Sysnative\\cscript.exe", "c:\\protect\\extras\\computername.vbs", "", -1, true);
Folder.DeleteTree("C:\\protemp\\", nil);
_NeedsReboot = true;
end

-- Choose Installation based on User Selection
if bsourceserver then
Service.Create("C:\\protect\\bin\\OGL protect failover helper.exe", "OGL protect failover helper", "OGL protect failover helper", SERVICE_WIN32_OWN_PROCESS, false, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, "", nil, nil, "", "");
Folder.DeleteTree("C:\\protemp\\", nil);
end

This is all in a Post-Install Script based on the package selected. However, I do prefer your product and appreciate I need to learn it.

Return to “Feature Requests”