Welcome,
Guest
|
CodeTyphon MS Windows (Win7, Win8.x, Win10 and Win11) OS Development, discussions and problems
TOPIC:
Tutorial: Install Several Versions of CT 9 years 6 months ago #7203
|
Hi everyone,
I would like to share with you my technique to have several working versions of CodeTyphon on the same machine ]Install Several Versions of CodeTyphon under Windows (manual or by script) Forewords This tutorial aims to permit you to install several versions of CodeTyphon on the same computer. CodeTyphon uses hard-coded installation and settings folders. It is hard to use two or more versions (a stable one + a dev one for example) for this reason. The solution I use is a VHD container with the content of C:\CodeTyphon and the AppData folders. The VHD is dynamically mounted, and CodeTyphon is used transparently. Among the advantages of this approach:
Prerequisite
Overview -= =Manual Installation – The hard way ==- Prepare your VHD If it doesn't exist yet, create the C:\CodeTyphon directory (it will be empty and used as mounting point for the VHD). If you already installed CodeTyphon, rename the existing directory as (CodeTyphon.bak) and create a new one, you will move its content later in the VHD. If you don't know how to create a VHD, follow the tutorial www.howtogeek.com/howto/5291/how-to-crea...-drive-in-windows-7/ Create you VHD file with a relevant name, such as CodeTyphon-530.vhd 5GB should be ok. You can make it dynamically expanding, but it is more slow. Don't forget to select it, initialize it (MBR), create a volume on it, and use the maximum of space. Mount it as T:\ (or any other letter) then format it as NTFS. As an additionnal mountpoint set it to C:\CodeTyphon. In VHD Attach, select your VHD file and set it as automount to have it mounted at every boot up. Prepare your AppData Go under C:\CodeTyphon (or T:\) and create the following directories: "c:\CodeTyphon\AppData\Roaming\typhon32\"
"c:\CodeTyphon\AppData\Roaming\typhon64\"
"c:\CodeTyphon\AppData\Local\Typhon Data Desktop\" Under Windows 7 and 8, your CodeTyphon configuration can be found (or will be created) in: "c:\Users\[yourUserName]\AppData\Roaming\typhon32\"
"c:\Users\[yourUserName]\AppData\Roaming\typhon64\"
"c:\Users\[yourUserName]\AppData\Local\Typhon Data Desktop\" If they do, we will have to copy their contents in their «mirrors» in the VHD container, and then delete them (otherwise mklink will not work). Create SymLinks Open a Dos Command Prompt (run, cmd) as Administrator or privileged used (try Win+X under Windows 8) and let's do symbolic links from your AppData to the VHD. See ss64.com/nt/mklink.html for more details, if it doesn't work, check your rights By default, only Administrators can create symbolic links.
The security setting 'Create symbolic links' can be granted at:
Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\ Replace yourUserName of course : mklink /D "c:\Users\yourUserName\AppData\Roaming\typhon32\" "c:\CodeTyphon\AppData\Roaming\typhon32"
mklink /D "c:\Users\yourUserName\AppData\Roaming\typhon64\" "c:\CodeTyphon\AppData\Roaming\typhon64"
mklink /D "c:\Users\yourUserName\AppData\Local\Typhon Data Desktop\" "c:\CodeTyphon\AppData\Local\Typhon Data Desktop\" Move or Install CodeTyphon Once everything has been done, you can install CodeTyphon as usual or move the content of c:\CodeTyphon.bak to C:\CodeTyphon. You existing links and installations will still be valid. -== Automated Installation – The easy way ==- You have the possibility to use the batch script below. There are a few settings you can change inside, and you will have to start it as Administrator. You can use it to prepare your disk to do a regular install after. Or, if there is already a valid installed CodeTyphon, be patient, it will take about 15-20 minutes to migrate it transparently and you will not have to reconfigure it after How it works (Flowchart) The Script (MakeCodeTyphonVHD.bat)
Warning: Spoiler!
@echo off
rem THIS SCRIPT MUST BE RUNNING AS ADMINISTRATOR !!!
rem Takes about 15-20 minutes on an already installed CodeTyphon
rem Brought to you by Tony_O_Gallos with love :)
rem -= HERE IS YOUR CONFIG - DO NOT PUT DOUBLE QUOTES AROUND NAMES =-
rem -- Where you will place your VHDs, will be created if needed
set VHDDir=C:\VHD
rem -- Name of the VHD you will create
set VHDName=CodeTyphon-530.vhd
rem -- VHDSize in MB, about 5000-6000 are needed (5-6GB)
set VHDSize=6000
rem -- Letter of your VHD Drive, needed during creation, not needed later
set VHDDriveLetter=T
rem -- Label of the volume (max 11 characters!!!)
set VHDVolumeLabel=CodeTyphon
rem -- Path and name of the VHD Creation Script (without double quotes)
set CreateVHDScriptFile=c:\VHDCreationScript.txt
set SetupDone=NO
rem -= END OF CONFIG =-
echo === Install CodeTyphon in VHD ===
c:
cd c:\
rem -- Check for user with Administrator privileges
NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
Set _ADMIN=YES
) ELSE (
Set _ADMIN=NO
)
if %_ADMIN%==YES goto CheckSetup
echo !!! This script needs to be running as Administrator. !!!
goto End
rem --Check if the Setup has been validated
:CheckSetup
IF %SetupDone%==NO goto SetupNotDone
goto CheckLetter
:SetupNotDone
echo !!! The Setup has not been done yet. !!!
echo !!! Please Edit this file, modify the setup and set SetupDone as YES !!!
goto End
:CheckLetter
rem -- Check if the drive letter is already in use (don't put double quotes !)
IF NOT EXIST %VHDDriveLetter%:\NUL goto FreeLetter
echo !!! This Drive letter is already in use !!!
echo !!! Unmount it or change the letter in the Setup !!!
goto End
:FreeLetter
rem -= Check if a VHD file with the same name already exist =-
IF NOT EXIST "%VHDDir%\%VHDName%" goto VHDCheckOk
echo !!! The VHD file "%VHDDir%\%VHDName%" already exist - Change the Setup - EXITING !!!
:VHDCheckOk
echo - VHD file "%VHDDir%\%VHDName%" not present, all ok
rem -= Create the VHD Dir if needed =-
IF EXIST "%VHDDir%" goto VHDDirOk
echo - Create %VHDDir%
mkdir "%VHDDir%"
:VHDDirOk
rem -= Rename existing CodeTyphon Dir if needed =-
IF EXIST "C:\CodeTyphon\binBase" goto CTInstalled
goto CreateCTDir
:CTInstalled
echo - Existing install of CodeTyphon Found - Saving it
c:
cd c:\
rename C:\CodeTyphon CodeTyphon.TOG
:CreateCTDir
IF EXIST "C:\CodeTyphon" goto CTDirOk
echo - Create C:\CodeTyphon
mkdir "C:\CodeTyphon"
:CTDirOk
rem -- https://technet.microsoft.com/en-us/magazine/ee872416.aspx
rem -- Create CreateVHDScriptFile
echo create vdisk file="%VHDDir%\%VHDName%" maximum=%VHDSize% > %CreateVHDScriptFile%
echo attach vdisk >> %CreateVHDScriptFile%
echo create partition primary >> %CreateVHDScriptFile%
echo format >> %CreateVHDScriptFile%
echo assign letter=%VHDDriveLetter% >> %CreateVHDScriptFile%
echo assign mount=c:\CodeTyphon >> %CreateVHDScriptFile%
echo - Please wait during the creation of the VHD container.
echo It takes a bit of time to create it and format it.
diskpart /s %CreateVHDScriptFile%
label %VHDDriveLetter%: %VHDVolumeLabel%
IF EXIST "%CreateVHDScriptFile%" del %CreateVHDScriptFile%
IF EXIST "%VHDDir%\%VHDName%" goto VHDCreatedOK
echo !!! VHD creation failed. Aborting... !!!
goto End
:VHDCreatedOK
echo - VHD created Ok
echo - Create "Mirror" directories
mkdir "C:\CodeTyphon\AppData\Roaming\typhon32\"
mkdir "C:\CodeTyphon\AppData\Roaming\typhon64\"
mkdir "C:\CodeTyphon\AppData\Local\Typhon Data Desktop\"
echo - Move existing config files
cd %APPDATA%
robocopy ".\typhon32" "C:\CodeTyphon\AppData\Roaming\typhon32" *.* /MOVE /E >NUL
robocopy ".\typhon64" "C:\CodeTyphon\AppData\Roaming\typhon64" *.* /MOVE /E >NUL
robocopy ".\..\Local\Typhon Data Desktop" "C:\CodeTyphon\AppData\Local\Typhon Data Desktop" *.* /MOVE /E >NUL
echo - Linking AppData folders to "Mirrors"
rem -- %APPDATA% means c:\Users\yourUserName\AppData\Roaming
cd %APPDATA%
mklink /D ".\typhon32\" "c:\CodeTyphon\AppData\Roaming\typhon32\"
mklink /D ".\typhon64\" "c:\CodeTyphon\AppData\Roaming\typhon64\"
cd ..
cd Local
mklink /D ".\Typhon Data Desktop\" "c:\CodeTyphon\AppData\Local\Typhon Data Desktop\"
rem -- Reinject the saved Installed version, if exists
IF NOT EXIST "C:\CodeTyphon.TOG" goto End
echo - Copying existing installed CodeTyphon in the VHD
echo It takes A LOT OF TIME, DON'T ABORT !!!
echo (about 15 minutes, there are more than 60,000 files to copy !)
c:
cd c:\
rem -- Magic command :P
robocopy c:\CodeTyphon.TOG C:\CodeTyphon *.* /MOVE /E >NUL
echo - ALL DONE ! Think about to make it automount at startup with VHD Attach ;)
:End What's next? Before to do any manipulation on the VHD, ensure you have closed CodeTyphon and Typhon IDE. From VHD Attach, unmount the VHD file. Duplicate it You want to install a new or Lab Version, but avoid to lose a working version? You should be able to keep the same links without to affect the rest.
Move it You can copy an unmounted VHD to a USB key or another computer, another drive. Bring your CodeTyphon to a friend… Compile it on you fastest computer, the copy it back on the slowest… Enjoy! Hoping this will help you You can apply such system to other applications which contain a lot of files. Use it the way you want, no licence/copyright on it Tony_O_Gallos Check
Wiki
and Forum first! -
Can't install CT? Check your Path!
-
Several Versions of CT in Windows (VHD)
Attachments:
The following user(s) said Thank You: Ahmad
|
Please Log in or Create an account to join the conversation.
Last edit: by Tony_O_Gallos.
|
Tutorial: Install Several Versions of CT 9 years 6 months ago #7204
|
I can't say anything
only a simple Thanks Sir PilotLogic Architect and Core Programmer
|
Please Log in or Create an account to join the conversation. |