degradacija Posted October 5, 2007 Share Posted October 5, 2007 (edited) Portable nLite – tutorial (more like guide then tutorial because there is no explanation but I'll edit this later and add explanations)1. Download and install thinstall vs 3.2 trial at http://www.thinstall.com/products/virtuali...on_suite_dl.php (must signup first)2. Download nLruntimeR3.exe at nliteos.com3. I presume you already have nLite 1.4 beta4. After you setup Thinstall VS go to c:\program files\Thinstall.VS create folder named Captures and inside create folder named 'nLite'5. In nLite folder create following folders: - %ProgramFilesDir% - %SystemRoot% - %SystemRoot%\winsxs - %SystemRoot%\winsxs\Manifests - %SystemRoot%\winsxs\Policies - %SystemSystem%6. Install nLruntimeR3.exe in your nLite-1.4.beta and move nLite-1.4.beta folder to %ProgramFilesDir%. Note that .net2 should not be installed otherwise use universal extractor to extract nLruntimeR3.7. nLruntimeR3 installed gdiplus.dll and mscoree.dll to system32 folder. Copy gdiplus.dll to nLite-1.4.beta and mscoree.dll to %SystemSystem%8. Check your C:\WINDOWS\WinSxS folder and see if you have VC8 runtimes: x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd if yes then continue otherwise move to step 9.copy folderC:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acdtoCaptures\nLite\%SystemRoot%\winsxscopy folder C:\WINDOWS\WinSxS\Policies\x86_policy.8.0.Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_x-ww_77c24773toCaptures\nLite\%SystemRoot%\winsxs\Policiescopy filesC:\WINDOWS\WinSxS\Manifests\x86_Microsoft.Windows.SystemCompatible_6595b64144ccf1df_5.1.0.0_x-ww_fc342b0b.ManifestC:\WINDOWS\WinSxS\Manifests\x86_Microsoft.Windows.SystemCompatible_6595b64144ccf1df_5.1.0.0_x-ww_fc342b0b.catC:\WINDOWS\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd.manifestC:\WINDOWS\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd.cattoCaptures\nLite\%SystemRoot%\winsxs\Manifests9. Only if you finished step 8 continue otherwise move to step 10. The following files appear in nLite-1.4.beta and v2.0.50727 folders so delete them from both locations msvcm80.dll msvcp80.dll msvcr80.dll Microsoft.VC80.CRT.manifest you could also delete unnecessary language files from Lang folder10. You also need comctl32.exe v. 6.0.2800.1106 search for it in your C:\WINDOWS\WinSxS folder since it was probably installed with some other application if you cant find it download it microsoft.com or google it.Put this file in %SystemSystem% folder.Note that it must be v. 6.0.2800.110611. Create .ini file named ##Attributes.ini containing following text:[isolation]DirectoryIsolationMode=Fullnow copy this file to following folders:- Captures\nLite-1.4.beta- Captures\nLite-1.4.beta\Presets- Captures\nLite-1.4.beta\Lang - Captures\nLite-1.4.beta\v2.0.50727- Captures\%SystemRoot%\winsxs- %SystemRoot%\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd- Captures\%SystemRoot%\winsxs\Manifests- Captures\%SystemRoot%\winsxs\Policies-%SystemRoot%\winsxs\Policies\x86_policy.8.0.Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_x-ww_77c24773Your project tree should look like this12. Create file Package.ini in folder nLite(your project root folder) containing following text: [BuildOptions]CapturedUsingVersion=3.207OutDir=binSandboxName=nLiteAddPageExecutionPermission=1ChildProcessEnvironmentDefault=External;ExternalCOMObjects={8BC3F05E-D86B-11D0-A075-00C04FB68820};{7D096C5F-AC08-4F1F-BEB7-5C22C517CE39};Enable this option if you want Out-of-process COM objects to be loaded outside of the virtual environment;By doing this, the application may indirectly modify the machine - for example the MSI installer service COM object;The default is to create all Out-of-process COM objects inside the virtual environment;VirtualizeExternalOutOfProcessCOM=0[Compression];CompressionType=NoneCompressionType=Fast[Isolation];DirectoryIsolationMode=WriteCopyDirectoryIsolationMode=Merged[nLite.exe]Source=%ProgramFilesDir%\nLite-1.4.beta\nlite.exeReadOnlyData=bin\Package.ro.tvrRetainAllIcons=1;;cmd.exe shortcut can be used to launch system apps in the virtual environment;[cmd.exe];Source=%SystemSystem%\cmd.exe;ReadOnlyData=bin\Package.ro.tvr;;regedit.exe can be used to inspect the virtual registry;[regedit.exe];Source=%SystemRoot%\regedit.exe;Shortcut=nlite.exe13. Create 3 empty txt files in nLite folder (project root) namedHKEY_CURRENT_USER.txtHKEY_LOCAL_MACHINE.txtHKEY_USERS.txtedit HKEY_LOCAL_MACHINE.txt to look like this:@echo offset PROJECT_DIR=%PROJECT_PATH%if exist %PROJECT_PATH% goto haspathset PROJECT_DIR=%CD%:haspathif exist "%THINSTALL_BIN%\vregtool.exe" goto foundset THINSTALL_BIN=%PROJECT_DIR%\..\..if exist "%THINSTALL_BIN%\vregtool.exe" goto foundset THINSTALL_BIN=c:\program files\Thinstall.VSif exist "%THINSTALL_BIN%\vregtool.exe" goto foundecho Could not find vregtool.exe, please set the environment variable THINSTALL_BIN or install to c:\program files\ThinstallVSgoto failed:foundif not exist "%THINSTALL_BIN%\vftool.exe" goto failedif not exist "%THINSTALL_BIN%\tlink.exe" goto failedif not exist "%PROJECT_DIR%\bin" mkdir "%PROJECT_DIR%\bin"if exist "%PROJECT_DIR%\bin\*.exe" del /f /q "%PROJECT_DIR%\bin\*.exe""%THINSTALL_BIN%\vregtool" "%PROJECT_DIR%\bin\Package.ro.tvr" ImportDir "%PROJECT_DIR%"IF ERRORLEVEL 1 GOTO failed"%THINSTALL_BIN%\vftool" "%PROJECT_DIR%\bin\Package.ro.tvr" ImportDir "%PROJECT_DIR%"IF ERRORLEVEL 1 GOTO failed"%THINSTALL_BIN%\tlink" "%PROJECT_DIR%\Package.ini" -OutDir "%PROJECT_DIR%\bin"IF ERRORLEVEL 1 GOTO failedgoto done:failedecho *** Build failed ***goto final:donedel "%PROJECT_DIR%\bin\*.tvr"del "%PROJECT_DIR%\bin\*.tvr.thfd"echo ---------------------------------------------echo Build complete:finalNow just execute build.bat and after it's done you will find your portable nLite.exe in bin folder in the root of your project.That's it, all done.You could apply this same tutorial for most .NET applications just put that apps folder in %ProgramFilesDir%\ and edit Package.ini accordingly, and put ##Attributes.ini in that apps folder and all subfolders.For example you could create portable WMP11Slipstreamercreate folder named WMP11S and put WMP11Slipstreamer.exe in.and just edit Package.ini replaceSandboxName=nLite[nLite.exe]Source=%ProgramFilesDir%\nLite-1.4.beta\nlite.exeReadOnlyData=bin\Package.ro.tvrRetainAllIcons=1withSandboxName=wmpslipstreamer[WMP11Slipstreamer.exe]Source=%ProgramFilesDir%\WMP11S\WMP11Slipstreamer.exeReadOnlyData=bin\Package.ro.tvrRetainAllIcons=1and build. Edited October 6, 2007 by degradacija Link to comment Share on other sites More sharing options...
Oleg_II Posted October 6, 2007 Share Posted October 6, 2007 Interesting But why you are still integrating nLite? If next version will be out should be re-do all this operations again? Why not to do it only for NET? For example, use %ProgramFiles%\nLite folder insted of %ProgramFiles%\nLite-1.4.beta. Will it be possible to use this portable NET installer with the following versions of nLite? Link to comment Share on other sites More sharing options...
degradacija Posted October 6, 2007 Author Share Posted October 6, 2007 Interesting But why you are still integrating nLite? If next version will be out should be re-do all this operations again? Why not to do it only for NET? For example, use %ProgramFiles%\nLite folder insted of %ProgramFiles%\nLite-1.4.beta. Will it be possible to use this portable NET installer with the following versions of nLite? Later I'll post another tutorial on how to create portable .NET, but as I've said before it will work only for simple apps (wmpslipstreamer) --nLite needs to be packed together with .NET in order for it to work.Each new version of nLite will have to be repacked.I'm not sure if you really understand the result of all this - bin\nLite.exe is binary that contains both nLite and .NET, you can delete nLite project folder just save bin\nLite.exe and try to execute it on another computer that doesn't have .NET installed. Link to comment Share on other sites More sharing options...
Oleg_II Posted October 6, 2007 Share Posted October 6, 2007 I understand what's happenning That is why I asked if it is possible to have only NET installer (that runs totally in virtual temporary evnironment My logic:1. nLite needs NET.2. nLite installed, NET is not installed.3. There is a NET installer that can be run before running nLite so the last one thought this computer has NET installed.I'm not sure about the 3 statement so I asked Link to comment Share on other sites More sharing options...
degradacija Posted October 6, 2007 Author Share Posted October 6, 2007 (edited) I understand what's happenning That is why I asked if it is possible to have only NET installer (that runs totally in virtual temporary evnironment My logic:1. nLite needs NET.2. nLite installed, NET is not installed.3. There is a NET installer that can be run before running nLite so the last one thought this computer has NET installed.I'm not sure about the 3 statement so I asked Yes you can build portable .NET (an executable, not a installer) environment using thinstall.nLite 1.4beta will not work with this portable environment because of the mcdbnet2.dll component wich needs to write to virtual registry of Portable.NET and therefore nLite 1.4 beta needs to be packed (thinstalled) together with portable .NET into single exe, however nlite1.0b1 will work because this version doesnt use mcdbnet2.dll component and therefore has no need to use virtual registry of portable.NETPortable .NET will work with every .NET app as long as that app doesn't need to use registry (for example wmp11slipstreamer). Edited October 6, 2007 by degradacija Link to comment Share on other sites More sharing options...
Oleg_II Posted October 6, 2007 Share Posted October 6, 2007 OK. So it's impossible to make separate executable for NET only for using with nLite now Anyway, thanks for the turorial - it's great! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now