This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
userspace:diskpart_-_dynamic_system_partition_resize [2015/09/17 17:09] larsg |
userspace:diskpart_-_dynamic_system_partition_resize [2021/08/23 08:37] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Resize system partition dynamically, | ====== Resize system partition dynamically, | ||
| - | | + | created by LarsG [[lars.gruenheid@civitec.de]] 2015/09/17 |
| * tested under windows 7 | * tested under windows 7 | ||
| * tested under winst 4.11.5.13 | * tested under winst 4.11.5.13 | ||
| - | In case you want your system partition to only use the amount of diskspace required by the applications you install, | + | In case you want your system partition to only use the amount of diskspace required by the system and the applications you install, |
| you can use the following code to extend your system partition dynamically before installing your software. | you can use the following code to extend your system partition dynamically before installing your software. | ||
| - | |||
| - | Integrate the following code into your installation script, and change the value of $MinimumFreeSpace$ to the amount of MB required by the software to install; 1 GB equals **1024**, like given as example below. | ||
| **!!! Warning !!!** | **!!! Warning !!!** | ||
| - | This can lead to problems if your applications or users are storing data on the system partition. | + | Using this can lead to problems if your applications or users are storing data on the system partition. |
| - | If you use this, you should | + | |
| - | f.e. move profiles to another partition, configure your applications to store their data on another partition, prevent write access for users on the system partition. | + | If you want use this, you should |
| - | take care ;) | + | Take care ;) |
| + | |||
| + | |||
| + | |||
| + | Integrate the following code into your installation script, and change the value of '' | ||
| - | ==== setup.ins ==== | ||
| <code winst> | <code winst> | ||
| - | [Actions] | + | [actions] |
| defVar $MinimumFreeSpace$ | defVar $MinimumFreeSpace$ | ||
| set $MinimumFreeSpace$ = " | set $MinimumFreeSpace$ = " | ||
| if not ( hasMinimumSpace( " | if not ( hasMinimumSpace( " | ||
| - | execwith_resize | + | comment "Not enough free space left, trying to extend volume %SystemDrive% by " + $MinimumFreeSpace$ + " MB." |
| + | execwith_resize_volume | ||
| + | if not ( hasMinimumSpace( " | ||
| + | logError " | ||
| + | isFatalError | ||
| + | endif | ||
| + | else | ||
| + | comment "Still enough free space left, continue with installation" | ||
| endif | endif | ||
| + | </ | ||
| - | comment " | + | <code winst> |
| + | [execwith_resize_volume] | ||
| + | select volume %SystemDrive% | ||
| + | extend size=$MinimumFreeSpace$ | ||
| + | </ | ||
| - | [execwith_resize] | + | This script assumes you install software on your system partition. Otherwise, you need to replace any occurance of '' |
| - | SELECT volume | + | f.e. extract it like this: |
| - | EXTEND size=$MinimumFreeSpace$ | + | |
| + | <code winst> | ||
| + | defVar $InstallDrive$ | ||
| + | set $InstallDrive$ | ||
| </ | </ | ||